Skip to content

Commit

Permalink
Apply class_keyword (#945)
Browse files Browse the repository at this point in the history
  • Loading branch information
kubawerlos committed Jan 8, 2024
1 parent 2f5c03b commit b58e7a0
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
2 changes: 0 additions & 2 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
}
}

unset($rules['class_keyword']); // temporary

// PhpCsFixerCustomFixersDev\Fixer\OrderedClassElementsInternalFixer will handle this
unset($rules['ordered_class_elements']);
unset($rules['ordered_interfaces']);
Expand Down
4 changes: 2 additions & 2 deletions src/Fixer/StringableInterfaceFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ private function addStringableInterface(Tokens $tokens, int $classIndex): void
new Token([\T_IMPLEMENTS, 'implements']),
new Token([\T_WHITESPACE, ' ']),
new Token([\T_NS_SEPARATOR, '\\']),
new Token([\T_STRING, 'Stringable']),
new Token([\T_STRING, \Stringable::class]),
],
);

Expand All @@ -223,7 +223,7 @@ private function addStringableInterface(Tokens $tokens, int $classIndex): void
$afterImplementsIndex,
[
new Token([\T_NS_SEPARATOR, '\\']),
new Token([\T_STRING, 'Stringable']),
new Token([\T_STRING, \Stringable::class]),
new Token(','),
new Token([\T_WHITESPACE, ' ']),
],
Expand Down
2 changes: 1 addition & 1 deletion tests/Fixer/StringableInterfaceFixerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public function __toString() { return "Foo"; }
';

$implementedInterfacesCases = [
'Stringable',
\Stringable::class,
'Foo\Stringable',
'\Foo\Stringable',
'Foo\Stringable\Bar',
Expand Down
2 changes: 1 addition & 1 deletion tests/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

require_once __DIR__ . '/../vendor/autoload.php';

if (!interface_exists('PhpCsFixer\\Fixer\\FixerInterface')) {
if (!interface_exists(PhpCsFixer\Fixer\FixerInterface::class)) {
$phars = [
__DIR__ . '/../vendor/php-cs-fixer/shim/php-cs-fixer.phar',
__DIR__ . '/../vendor/php-cs-fixer/shim/php-cs-fixer',
Expand Down

0 comments on commit b58e7a0

Please sign in to comment.