Skip to content

Commit

Permalink
Fix issue with new PHP CS Fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
driftingly committed Jun 20, 2024
1 parent e7c38d5 commit 27b3d12
Show file tree
Hide file tree
Showing 12 changed files with 235 additions and 241 deletions.
3 changes: 1 addition & 2 deletions app/Actions/Clean.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ class Clean
public function __construct(
protected string $mode,
protected array $tools,
) {
}
) {}

public function execute(): int
{
Expand Down
4 changes: 1 addition & 3 deletions app/Contracts/PintInputInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@

use Symfony\Component\Console\Input\InputInterface;

interface PintInputInterface extends InputInterface
{
}
interface PintInputInterface extends InputInterface {}
66 changes: 32 additions & 34 deletions app/Fixer/ClassNotation/CustomControllerOrderFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,40 +15,6 @@ public function getName(): string
return 'Tighten/custom_controller_order';
}

public function configure(array $configuration): void
{
$configuration['order'] = [
'use_trait',
'property_public_static',
'property_protected_static',
'property_private_static',
'constant_public',
'constant_protected',
'constant_private',
'property_public',
'property_protected',
'property_private',
'construct',
'method:__invoke',
'method_public_static',
'method_protected_static',
'method_private_static',
'method:index',
'method:create',
'method:store',
'method:show',
'method:edit',
'method:update',
'method:destroy',
'method_public',
'method_protected',
'method_private',
'magic',
];

parent::configure($configuration);
}

/**
* {@inheritdoc}
*
Expand Down Expand Up @@ -103,6 +69,38 @@ public function isControllerClass(Tokens $tokens, int $index): bool
return false;
}

protected function configurePreNormalisation(array &$configuration): void
{
$configuration['order'] = $configuration['order'] ?? [
'use_trait',
'property_public_static',
'property_protected_static',
'property_private_static',
'constant_public',
'constant_protected',
'constant_private',
'property_public',
'property_protected',
'property_private',
'construct',
'method:__invoke',
'method_public_static',
'method_protected_static',
'method_private_static',
'method:index',
'method:create',
'method:store',
'method:show',
'method:edit',
'method:update',
'method:destroy',
'method_public',
'method_protected',
'method_private',
'magic',
];
}

protected function applyFix(SplFileInfo $file, Tokens $tokens): void
{
for ($index = $tokens->count() - 1; $index > 0; $index--) {
Expand Down
Loading

0 comments on commit 27b3d12

Please sign in to comment.