Skip to content

Commit

Permalink
Add fixer's descriptions (#910)
Browse files Browse the repository at this point in the history
  • Loading branch information
kubawerlos committed Jul 12, 2023
1 parent c047e00 commit 2d47fb9
Show file tree
Hide file tree
Showing 47 changed files with 47 additions and 11 deletions.
1 change: 1 addition & 0 deletions src/Fixer/CommentSurroundedBySpacesFixer.php
Expand Up @@ -27,6 +27,7 @@ public function getDefinition(): FixerDefinitionInterface
[new CodeSample('<?php
/*foo*/
')],
'',
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Fixer/CommentedOutFunctionFixer.php
Expand Up @@ -36,7 +36,7 @@ public function getDefinition(): FixerDefinitionInterface
[new CodeSample('<?php
var_dump($x);
')],
null,
'',
'when any of the configured functions have side effects or are overwritten',
);
}
Expand Down
1 change: 1 addition & 0 deletions src/Fixer/ConstructorEmptyBracesFixer.php
Expand Up @@ -36,6 +36,7 @@ public function __construct(
',
),
],
'',
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Fixer/DataProviderNameFixer.php
Expand Up @@ -57,7 +57,7 @@ public function dataProvider() {}
',
),
],
null,
'',
'when relying on name of data provider function',
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Fixer/DataProviderReturnTypeFixer.php
Expand Up @@ -40,7 +40,7 @@ public function provideSomethingCases(): array {}
',
),
],
null,
'',
'when relying on signature of data provider',
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Fixer/DataProviderStaticFixer.php
Expand Up @@ -52,7 +52,7 @@ public function provideSomethingCases() {}
',
),
],
null,
'',
'when `force` is set to `true`',
);
}
Expand Down
1 change: 1 addition & 0 deletions src/Fixer/DeclareAfterOpeningTagFixer.php
Expand Up @@ -26,6 +26,7 @@ public function getDefinition(): FixerDefinitionInterface
return new FixerDefinition(
'Declare statement for strict types must be placed in the same line, after opening tag.',
[new CodeSample("<?php\n\$foo;\ndeclare(strict_types=1);\n\$bar;\n")],
'',
);
}

Expand Down
1 change: 1 addition & 0 deletions src/Fixer/EmptyFunctionBodyFixer.php
Expand Up @@ -28,6 +28,7 @@ public function getDefinition(): FixerDefinitionInterface
{
}
')],
'',
);
}

Expand Down
1 change: 1 addition & 0 deletions src/Fixer/InternalClassCasingFixer.php
Expand Up @@ -36,6 +36,7 @@ public function getDefinition(): FixerDefinitionInterface
return new FixerDefinition(
'Classes defined internally by extension or core must be referenced with the correct case.',
[new CodeSample("<?php\n\$foo = new STDClass();\n")],
'',
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Fixer/IssetToArrayKeyExistsFixer.php
Expand Up @@ -33,7 +33,7 @@ public function getDefinition(): FixerDefinitionInterface
',
),
],
null,
'',
'when array is not defined, is multi-dimensional or behaviour is relying on the null value',
);
}
Expand Down
1 change: 1 addition & 0 deletions src/Fixer/MultilineCommentOpeningClosingAloneFixer.php
Expand Up @@ -25,6 +25,7 @@ public function getDefinition(): FixerDefinitionInterface
return new FixerDefinition(
'Multiline comments or PHPDocs must contain an opening and closing line with no additional content.',
[new CodeSample("<?php\n/** Hello\n * World!\n */;\n")],
'',
);
}

Expand Down
1 change: 1 addition & 0 deletions src/Fixer/MultilinePromotedPropertiesFixer.php
Expand Up @@ -45,6 +45,7 @@ public function __construct(private array $a, private bool $b, private int $i) {
new VersionSpecification(80000),
),
],
'',
);
}

Expand Down
1 change: 1 addition & 0 deletions src/Fixer/NoCommentedOutCodeFixer.php
Expand Up @@ -27,6 +27,7 @@ public function getDefinition(): FixerDefinitionInterface
return new FixerDefinition(
'There can be no commented out code.',
[new CodeSample("<?php\n//var_dump(\$_POST);\nprint_r(\$_POST);\n")],
'',
);
}

Expand Down
1 change: 1 addition & 0 deletions src/Fixer/NoDoctrineMigrationsGeneratedCommentFixer.php
Expand Up @@ -43,6 +43,7 @@ public function down(Schema $schema)
}
}
')],
'',
);
}

Expand Down
1 change: 1 addition & 0 deletions src/Fixer/NoDuplicatedArrayKeyFixer.php
Expand Up @@ -41,6 +41,7 @@ public function getDefinition(): FixerDefinitionInterface
"foo" => 3,
];
')],
'',
);
}

Expand Down
1 change: 1 addition & 0 deletions src/Fixer/NoDuplicatedImportsFixer.php
Expand Up @@ -32,6 +32,7 @@ public function getDefinition(): FixerDefinitionInterface
use Foo;
use Bar;
')],
'',
);
}

Expand Down
1 change: 1 addition & 0 deletions src/Fixer/NoImportFromGlobalNamespaceFixer.php
Expand Up @@ -33,6 +33,7 @@ class Bar {
public function __construct(DateTime $dateTime) {}
}
')],
'',
);
}

Expand Down
1 change: 1 addition & 0 deletions src/Fixer/NoLeadingSlashInGlobalNamespaceFixer.php
Expand Up @@ -28,6 +28,7 @@ public function getDefinition(): FixerDefinitionInterface
namespace Bar;
$y = new \Baz();
')],
'',
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Fixer/NoNullableBooleanTypeFixer.php
Expand Up @@ -28,7 +28,7 @@ function foo(?bool $bar) : ?bool
return $bar;
}
')],
null,
'',
'when the null is used',
);
}
Expand Down
1 change: 1 addition & 0 deletions src/Fixer/NoPhpStormGeneratedCommentFixer.php
Expand Up @@ -33,6 +33,7 @@ public function getDefinition(): FixerDefinitionInterface
*/
namespace Foo;
')],
'',
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Fixer/NoReferenceInFunctionDefinitionFixer.php
Expand Up @@ -26,7 +26,7 @@ public function getDefinition(): FixerDefinitionInterface
[new CodeSample('<?php
function foo(&$x) {}
')],
null,
'',
'when rely on reference',
);
}
Expand Down
1 change: 1 addition & 0 deletions src/Fixer/NoSuperfluousConcatenationFixer.php
Expand Up @@ -32,6 +32,7 @@ public function getDefinition(): FixerDefinitionInterface
return new FixerDefinition(
'There should be no superfluous concatenation of strings.',
[new CodeSample("<?php\necho 'foo' . 'bar';\n")],
'',
);
}

Expand Down
1 change: 1 addition & 0 deletions src/Fixer/NoTrailingCommaInSinglelineFixer.php
Expand Up @@ -26,6 +26,7 @@ public function getDefinition(): FixerDefinitionInterface
[
new CodeSample("<?php\n\$x = ['foo', 'bar', ];\n"),
],
'',
);
}

Expand Down
1 change: 1 addition & 0 deletions src/Fixer/NoUselessCommentFixer.php
Expand Up @@ -38,6 +38,7 @@ function getBar() {}
}
'),
],
'',
);
}

Expand Down
1 change: 1 addition & 0 deletions src/Fixer/NoUselessDirnameCallFixer.php
Expand Up @@ -27,6 +27,7 @@ public function getDefinition(): FixerDefinitionInterface
[new CodeSample('<?php
require dirname(__DIR__) . "/vendor/autoload.php";
')],
'',
);
}

Expand Down
1 change: 1 addition & 0 deletions src/Fixer/NoUselessDoctrineRepositoryCommentFixer.php
Expand Up @@ -32,6 +32,7 @@ public function getDefinition(): FixerDefinitionInterface
*/
class FooRepository extends EntityRepository {}
')],
'',
);
}

Expand Down
1 change: 1 addition & 0 deletions src/Fixer/NoUselessParenthesisFixer.php
Expand Up @@ -29,6 +29,7 @@ public function getDefinition(): FixerDefinitionInterface
foo(($bar));
'),
],
'',
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Fixer/NoUselessStrlenFixer.php
Expand Up @@ -33,7 +33,7 @@ public function getDefinition(): FixerDefinitionInterface
',
),
],
null,
'',
'when the function `strlen` is overridden',
);
}
Expand Down
1 change: 1 addition & 0 deletions src/Fixer/NumericLiteralSeparatorFixer.php
Expand Up @@ -54,6 +54,7 @@ public function getDefinition(): FixerDefinitionInterface
',
new VersionSpecification(70400),
)],
'',
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Fixer/PhpUnitAssertArgumentsOrderFixer.php
Expand Up @@ -51,7 +51,7 @@ public function testFoo() {
}
}
')],
null,
'',
'when original PHPUnit methods are overwritten',
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Fixer/PhpUnitDedicatedAssertFixer.php
Expand Up @@ -56,7 +56,7 @@ public function testFoo() {
}
}
')],
null,
'',
'when original PHPUnit methods are overwritten',
);
}
Expand Down
1 change: 1 addition & 0 deletions src/Fixer/PhpdocArrayStyleFixer.php
Expand Up @@ -32,6 +32,7 @@ function foo() { return [1, 2]; }
',
),
],
'',
);
}

Expand Down
1 change: 1 addition & 0 deletions src/Fixer/PhpdocNoIncorrectVarAnnotationFixer.php
Expand Up @@ -31,6 +31,7 @@ public function getDefinition(): FixerDefinitionInterface
/** @var Foo $foo */
$bar = new Foo();
')],
'',
);
}

Expand Down
1 change: 1 addition & 0 deletions src/Fixer/PhpdocNoSuperfluousParamFixer.php
Expand Up @@ -34,6 +34,7 @@ public function getDefinition(): FixerDefinitionInterface
*/
function foo($b, $s) {}
')],
'',
);
}

Expand Down
1 change: 1 addition & 0 deletions src/Fixer/PhpdocOnlyAllowedAnnotationsFixer.php
Expand Up @@ -44,6 +44,7 @@ function foo_bar() {}
',
['elements' => ['author', 'version']],
)],
'',
);
}

Expand Down
1 change: 1 addition & 0 deletions src/Fixer/PhpdocParamOrderFixer.php
Expand Up @@ -42,6 +42,7 @@ public function getDefinition(): FixerDefinitionInterface
*/
function foo($a, $b, $c) {}
')],
'',
);
}

Expand Down
1 change: 1 addition & 0 deletions src/Fixer/PhpdocParamTypeFixer.php
Expand Up @@ -31,6 +31,7 @@ public function getDefinition(): FixerDefinitionInterface
*/
function a($foo, $bar) {}
')],
'',
);
}

Expand Down
1 change: 1 addition & 0 deletions src/Fixer/PhpdocSelfAccessorFixer.php
Expand Up @@ -35,6 +35,7 @@ class Foo {
private $instance;
}
')],
'',
);
}

Expand Down
1 change: 1 addition & 0 deletions src/Fixer/PhpdocSingleLineVarFixer.php
Expand Up @@ -32,6 +32,7 @@ class Foo {
private $name;
}
')],
'',
);
}

Expand Down
1 change: 1 addition & 0 deletions src/Fixer/PhpdocTypesCommaSpacesFixer.php
Expand Up @@ -23,6 +23,7 @@ public function getDefinition(): FixerDefinitionInterface
return new FixerDefinition(
'PHPDoc types commas must not be preceded by whitespace, and must be succeeded by single whitespace.',
[new CodeSample("<?php /** @var array<int,string> */\n")],
'',
);
}

Expand Down
1 change: 1 addition & 0 deletions src/Fixer/PhpdocTypesTrimFixer.php
Expand Up @@ -28,6 +28,7 @@ public function getDefinition(): FixerDefinitionInterface
*/
function foo($x) {}
')],
'',
);
}

Expand Down
1 change: 1 addition & 0 deletions src/Fixer/PhpdocVarAnnotationToAssertFixer.php
Expand Up @@ -30,6 +30,7 @@ public function getDefinition(): FixerDefinitionInterface
/** @var string $x */
$x = getValue();
')],
'',
);
}

Expand Down
1 change: 1 addition & 0 deletions src/Fixer/PromotedConstructorPropertyFixer.php
Expand Up @@ -54,6 +54,7 @@ public function __construct(string $bar) {
new VersionSpecification(80000),
),
],
'',
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Fixer/ReadonlyPromotedPropertiesFixer.php
Expand Up @@ -38,7 +38,7 @@ public function __construct(
new VersionSpecification(80100),
),
],
null,
'',
'when property is written',
);
}
Expand Down
1 change: 1 addition & 0 deletions src/Fixer/SingleSpaceAfterStatementFixer.php
Expand Up @@ -86,6 +86,7 @@ public function getDefinition(): FixerDefinitionInterface
return new FixerDefinition(
'Statements not followed by a semicolon must be followed by a single space.',
[new CodeSample("<?php\n\$foo = new Foo();\necho\$foo->bar();\n")],
'',
);
}

Expand Down
1 change: 1 addition & 0 deletions src/Fixer/SingleSpaceBeforeStatementFixer.php
Expand Up @@ -80,6 +80,7 @@ public function getDefinition(): FixerDefinitionInterface
return new FixerDefinition(
'Statements not preceded by a line break must be preceded by a single space.',
[new CodeSample("<?php\n\$foo =new Foo();\n")],
'',
);
}

Expand Down
1 change: 1 addition & 0 deletions src/Fixer/StringableInterfaceFixer.php
Expand Up @@ -32,6 +32,7 @@ public function __toString()
}
}
')],
'',
);
}

Expand Down

0 comments on commit 2d47fb9

Please sign in to comment.