{"id":13593852,"url":"https://github.com/kubawerlos/php-cs-fixer-custom-fixers","last_synced_at":"2025-05-14T19:10:27.409Z","repository":{"id":32456313,"uuid":"134319517","full_name":"kubawerlos/php-cs-fixer-custom-fixers","owner":"kubawerlos","description":"A set of custom fixers for PHP CS Fixer","archived":false,"fork":false,"pushed_at":"2025-05-09T10:44:46.000Z","size":2574,"stargazers_count":226,"open_issues_count":5,"forks_count":20,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-05-14T10:59:09.390Z","etag":null,"topics":["code-standards","code-style","php","php-cs-fixer","static-analysis"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kubawerlos.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-05-21T20:06:07.000Z","updated_at":"2025-05-09T10:44:49.000Z","dependencies_parsed_at":"2023-01-14T21:16:33.746Z","dependency_job_id":"9d22a32a-ecb8-4225-9357-c892a398b207","html_url":"https://github.com/kubawerlos/php-cs-fixer-custom-fixers","commit_stats":{"total_commits":874,"total_committers":13,"mean_commits":67.23076923076923,"dds":0.1819221967963387,"last_synced_commit":"4c6aeae359f6d454056bd65c1c596d66a465d45f"},"previous_names":[],"tags_count":82,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kubawerlos%2Fphp-cs-fixer-custom-fixers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kubawerlos%2Fphp-cs-fixer-custom-fixers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kubawerlos%2Fphp-cs-fixer-custom-fixers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kubawerlos%2Fphp-cs-fixer-custom-fixers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kubawerlos","download_url":"https://codeload.github.com/kubawerlos/php-cs-fixer-custom-fixers/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254209859,"owners_count":22032897,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["code-standards","code-style","php","php-cs-fixer","static-analysis"],"created_at":"2024-08-01T16:01:25.445Z","updated_at":"2025-05-14T19:10:25.701Z","avatar_url":"https://github.com/kubawerlos.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"\u003c!-- This file is generated by ReadmeCommand --\u003e\n\n# PHP CS Fixer: custom fixers\n\n[![Latest stable version](https://img.shields.io/packagist/v/kubawerlos/php-cs-fixer-custom-fixers.svg?label=current%20version)](https://packagist.org/packages/kubawerlos/php-cs-fixer-custom-fixers)\n[![PHP version](https://img.shields.io/packagist/php-v/kubawerlos/php-cs-fixer-custom-fixers.svg)](https://php.net)\n[![License](https://img.shields.io/github/license/kubawerlos/php-cs-fixer-custom-fixers.svg)](LICENSE)\n![Tests](https://img.shields.io/badge/tests-3691-brightgreen.svg)\n[![Downloads](https://img.shields.io/packagist/dt/kubawerlos/php-cs-fixer-custom-fixers.svg)](https://packagist.org/packages/kubawerlos/php-cs-fixer-custom-fixers)\n\n[![CI status](https://github.com/kubawerlos/php-cs-fixer-custom-fixers/actions/workflows/ci.yaml/badge.svg)](https://github.com/kubawerlos/php-cs-fixer-custom-fixers/actions/workflows/ci.yaml)\n[![Code coverage](https://img.shields.io/coveralls/github/kubawerlos/php-cs-fixer-custom-fixers/main.svg)](https://coveralls.io/github/kubawerlos/php-cs-fixer-custom-fixers?branch=main)\n[![Mutation testing badge](https://img.shields.io/endpoint?style=flat\u0026url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Fkubawerlos%2Fphp-cs-fixer-custom-fixers%2Fmain)](https://dashboard.stryker-mutator.io/reports/github.com/kubawerlos/php-cs-fixer-custom-fixers/main)\n[![Psalm type coverage](https://shepherd.dev/github/kubawerlos/php-cs-fixer-custom-fixers/coverage.svg)](https://shepherd.dev/github/kubawerlos/php-cs-fixer-custom-fixers)\n\nA set of custom fixers for [PHP CS Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer).\n\n## Installation\nPHP CS Fixer: custom fixers can be installed by running:\n```bash\ncomposer require --dev kubawerlos/php-cs-fixer-custom-fixers\n```\n\n\n## Usage\nIn your PHP CS Fixer configuration register fixers and use them:\n```diff\n \u003c?php\n return (new PhpCsFixer\\Config())\n+    -\u003eregisterCustomFixers(new PhpCsFixerCustomFixers\\Fixers())\n     -\u003esetRules([\n         '@PSR2' =\u003e true,\n         'array_syntax' =\u003e ['syntax' =\u003e 'short'],\n+        PhpCsFixerCustomFixers\\Fixer\\NoLeadingSlashInGlobalNamespaceFixer::name() =\u003e true,\n+        PhpCsFixerCustomFixers\\Fixer\\PhpdocNoSuperfluousParamFixer::name() =\u003e true,\n     ]);\n```\n:warning: When PHP CS Fixer is installed via [`php-cs-fixer/shim`](https://github.com/PHP-CS-Fixer/shim) package,\nrequiring bootstrap may be needed to load `PhpCsFixerCustomFixers` classes:\n```php\nrequire __DIR__ . '/vendor/kubawerlos/php-cs-fixer-custom-fixers/bootstrap.php';\n```\n\n\n## Fixers\n#### ClassConstantUsageFixer\nClass constant must be used instead of a copy of string.\n```diff\n \u003c?php\n class Foo\n {\n     public const BAR = 'bar';\n     public function bar()\n     {\n-        return 'bar';\n+        return self::BAR;\n     }\n }\n```\n\n#### CommentSurroundedBySpacesFixer\nComments must be surrounded by spaces.\n```diff\n \u003c?php\n-/*foo*/\n+/* foo */\n```\n\n#### CommentedOutFunctionFixer\nThe configured functions must be commented out.\n  *Risky: when any of the configured functions have side effects or are overwritten.*\nConfiguration options:\n- `functions` (`array`): list of functions to comment out; defaults to `['print_r', 'var_dump', 'var_export']`\n```diff\n \u003c?php\n-var_dump($x);\n+//var_dump($x);\n```\n\n#### ConstructorEmptyBracesFixer\nConstructor's empty braces must be on a single line.\n```diff\n \u003c?php\n class Foo {\n     public function __construct(\n         $param1,\n         $param2\n-    ) {\n-    }\n+    ) {}\n }\n```\n\n#### DataProviderNameFixer\nData provider names must match the name of the test.\n  DEPRECATED: use `php_unit_data_provider_name` instead.\n  *Risky: when relying on name of data provider function.*\nConfiguration options:\n- `prefix` (`string`): prefix that replaces \"test\"; defaults to `'provide'`\n- `suffix` (`string`): suffix to be added at the end\"; defaults to `'Cases'`\n```diff\n \u003c?php\n class FooTest extends TestCase {\n     /**\n-     * @dataProvider dataProvider\n+     * @dataProvider provideSomethingCases\n      */\n     public function testSomething($expected, $actual) {}\n-    public function dataProvider() {}\n+    public function provideSomethingCases() {}\n }\n```\n\n#### DataProviderReturnTypeFixer\nThe return type of PHPUnit data provider must be `iterable`.\n  DEPRECATED: use `php_unit_data_provider_return_type` instead.\n  *Risky: when relying on signature of data provider.*\n```diff\n \u003c?php\n class FooTest extends TestCase {\n     /**\n      * @dataProvider provideSomethingCases\n      */\n     public function testSomething($expected, $actual) {}\n-    public function provideSomethingCases(): array {}\n+    public function provideSomethingCases(): iterable {}\n }\n```\n\n#### DataProviderStaticFixer\nData providers must be static.\n  DEPRECATED: use `php_unit_data_provider_static` instead.\n  *Risky: when `force` is set to `true`.*\nConfiguration options:\n- `force` (`bool`): whether to make static data providers having dynamic class calls; defaults to `false`\n```diff\n \u003c?php\n class FooTest extends TestCase {\n     /**\n      * @dataProvider provideSomethingCases\n      */\n     public function testSomething($expected, $actual) {}\n-    public function provideSomethingCases() {}\n+    public static function provideSomethingCases() {}\n }\n```\n\n#### DeclareAfterOpeningTagFixer\nDeclare statement for strict types must be placed on the same line, after the opening tag.\n```diff\n-\u003c?php\n+\u003c?php declare(strict_types=1);\n $foo;\n-declare(strict_types=1);\n $bar;\n```\n\n#### EmptyFunctionBodyFixer\nEmpty function body must be abbreviated as `{}` and placed on the same line as the previous symbol, separated with a space.\n```diff\n \u003c?php function foo(\n     int $x\n-)\n-{\n-}\n+) {}\n```\n\n#### ForeachUseValueFixer\nValue from `foreach` must not be used if possible.\n  *Risky: when the value is re-used or being sorted.*\n```diff\n \u003c?php\n foreach ($elements as $key =\u003e $value) {\n-    $product *= $elements[$key];\n+    $product *= $value;\n }\n```\n\n#### InternalClassCasingFixer\nClasses defined internally by an extension or the core must be referenced with the correct case.\n  DEPRECATED: use `class_reference_name_casing` instead.\n```diff\n \u003c?php\n-$foo = new STDClass();\n+$foo = new stdClass();\n```\n\n#### IssetToArrayKeyExistsFixer\nFunction `array_key_exists` must be used instead of `isset` when possible.\n  *Risky: when array is not defined, is multi-dimensional or behaviour is relying on the null value.*\n```diff\n \u003c?php\n-if (isset($array[$key])) {\n+if (array_key_exists($key, $array)) {\n     echo $array[$key];\n }\n```\n\n#### MultilineCommentOpeningClosingAloneFixer\nMultiline comments or PHPDocs must contain an opening and closing line with no additional content.\n```diff\n \u003c?php\n-/** Hello\n+/**\n+ * Hello\n  * World!\n  */\n```\n\n#### MultilinePromotedPropertiesFixer\nPromoted properties must be on separate lines.\nConfiguration options:\n- `keep_blank_lines` (`bool`): whether to keep blank lines between properties; defaults to `false`\n- `minimum_number_of_parameters` (`int`): minimum number of parameters in the constructor to fix; defaults to `1`\n```diff\n \u003c?php class Foo {\n-    public function __construct(private array $a, private bool $b, private int $i) {}\n+    public function __construct(\n+        private array $a,\n+        private bool $b,\n+        private int $i\n+    ) {}\n }\n```\n\n#### NoCommentedOutCodeFixer\nThere must be no commented out code.\n```diff\n \u003c?php\n-//var_dump($_POST);\n print_r($_POST);\n```\n\n#### NoDoctrineMigrationsGeneratedCommentFixer\nThere must be no comments generated by Doctrine Migrations.\n```diff\n \u003c?php\n namespace Migrations;\n use Doctrine\\DBAL\\Schema\\Schema;\n-/**\n- * Auto-generated Migration: Please modify to your needs!\n- */\n final class Version20180609123456 extends AbstractMigration\n {\n     public function up(Schema $schema)\n     {\n-        // this up() migration is auto-generated, please modify it to your needs\n         $this-\u003eaddSql(\"UPDATE t1 SET col1 = col1 + 1\");\n     }\n     public function down(Schema $schema)\n     {\n-        // this down() migration is auto-generated, please modify it to your needs\n         $this-\u003eaddSql(\"UPDATE t1 SET col1 = col1 - 1\");\n     }\n }\n```\n\n#### NoDuplicatedArrayKeyFixer\nThere must be no duplicate array keys.\nConfiguration options:\n- `ignore_expressions` (`bool`): whether to keep duplicated expressions (as they might return different values) or not; defaults to `true`\n```diff\n \u003c?php\n $x = [\n-    \"foo\" =\u003e 1,\n     \"bar\" =\u003e 2,\n     \"foo\" =\u003e 3,\n ];\n```\n\n#### NoDuplicatedImportsFixer\nThere must be no duplicate `use` statements.\n```diff\n \u003c?php\n namespace FooBar;\n use Foo;\n-use Foo;\n use Bar;\n```\n\n#### NoImportFromGlobalNamespaceFixer\nThere must be no imports from the global namespace.\n```diff\n \u003c?php\n namespace Foo;\n-use DateTime;\n class Bar {\n-    public function __construct(DateTime $dateTime) {}\n+    public function __construct(\\DateTime $dateTime) {}\n }\n```\n\n#### NoLeadingSlashInGlobalNamespaceFixer\nClasses in the global namespace cannot contain leading slashes.\n```diff\n \u003c?php\n-$x = new \\Foo();\n+$x = new Foo();\n namespace Bar;\n $y = new \\Baz();\n```\n\n#### NoNullableBooleanTypeFixer\nThere must be no nullable boolean types.\n  *Risky: when the null is used.*\n```diff\n \u003c?php\n-function foo(?bool $bar) : ?bool\n+function foo(bool $bar) : bool\n {\n      return $bar;\n  }\n```\n\n#### NoPhpStormGeneratedCommentFixer\nThere must be no comments generated by PhpStorm.\n```diff\n \u003c?php\n-/**\n- * Created by PhpStorm.\n- * User: root\n- * Date: 01.01.70\n- * Time: 12:00\n- */\n namespace Foo;\n```\n\n#### NoReferenceInFunctionDefinitionFixer\nThere must be no parameters passed by reference in functions.\n  *Risky: when rely on reference.*\n```diff\n \u003c?php\n-function foo(\u0026$x) {}\n+function foo($x) {}\n```\n\n#### NoSuperfluousConcatenationFixer\nThere must be no superfluous concatenation of literal strings.\nConfiguration options:\n- `allow_preventing_trailing_spaces` (`bool`): whether to keep concatenation if it prevents having trailing spaces in string; defaults to `false`\n- `keep_concatenation_for_different_quotes` (`bool`): whether to keep concatenation if single-quoted and double-quoted would be concatenated; defaults to `false`\n```diff\n \u003c?php\n-echo 'foo' . 'bar';\n+echo 'foobar';\n```\n\n#### NoTrailingCommaInSinglelineFixer\nAn element list written on one line cannot contain a trailing comma.\n```diff\n \u003c?php\n-$x = ['foo', 'bar', ];\n+$x = ['foo', 'bar'];\n```\n\n#### NoUselessCommentFixer\nThere must be no useless comments.\n```diff\n \u003c?php\n /**\n- * Class Foo\n  * Class to do something\n  */\n class Foo {\n     /**\n-     * Get bar\n      */\n     function getBar() {}\n }\n```\n\n#### NoUselessDirnameCallFixer\nThere must be no useless `dirname` calls.\n```diff\n \u003c?php\n-require dirname(__DIR__) . \"/vendor/autoload.php\";\n+require __DIR__ . \"/../vendor/autoload.php\";\n```\n\n#### NoUselessDoctrineRepositoryCommentFixer\nThere can be no comments generated by Doctrine ORM.\n```diff\n \u003c?php\n-/**\n- * FooRepository\n- *\n- * This class was generated by the Doctrine ORM. Add your own custom\n- * repository methods below.\n- */\n class FooRepository extends EntityRepository {}\n```\n\n#### NoUselessParenthesisFixer\nThere must be no useless parentheses.\n```diff\n \u003c?php\n-foo(($bar));\n+foo($bar);\n```\n\n#### NoUselessStrlenFixer\nFunctions `strlen` and `mb_strlen` must not be compared to 0.\n  *Risky: when the function `strlen` is overridden.*\n```diff\n \u003c?php\n-$isEmpty = strlen($string) === 0;\n-$isNotEmpty = strlen($string) \u003e 0;\n+$isEmpty = $string === '';\n+$isNotEmpty = $string !== '';\n```\n\n#### NoUselessWriteVisibilityFixer\nThere must be no useless write visibility.\n```diff\n \u003c?php class Foo {\n-    public public(set) $x;\n-    public(set) $y;\n-    protected protected(set) $z;\n+    public $x;\n+    public $y;\n+    protected $z;\n }\n```\n\n#### NumericLiteralSeparatorFixer\nNumeric literals must have configured separators.\n  DEPRECATED: use `numeric_literal_separator` instead.\nConfiguration options:\n- `binary` (`bool`, `null`): whether add, remove or ignore separators in binary numbers.; defaults to `false`\n- `decimal` (`bool`, `null`): whether add, remove or ignore separators in decimal numbers.; defaults to `false`\n- `float` (`bool`, `null`): whether add, remove or ignore separators in float numbers.; defaults to `false`\n- `hexadecimal` (`bool`, `null`): whether add, remove or ignore separators in hexadecimal numbers.; defaults to `false`\n- `octal` (`bool`, `null`): whether add, remove or ignore separators in octal numbers.; defaults to `false`\n```diff\n \u003c?php\n-echo 0b01010100_01101000; // binary\n-echo 135_798_642; // decimal\n-echo 1_234.456_78e-4_321; // float\n-echo 0xAE_B0_42_FC; // hexadecimal\n-echo 0123_4567; // octal\n+echo 0b0101010001101000; // binary\n+echo 135798642; // decimal\n+echo 1234.45678e-4321; // float\n+echo 0xAEB042FC; // hexadecimal\n+echo 01234567; // octal\n```\n\n#### PhpUnitAssertArgumentsOrderFixer\nPHPUnit assertions must have expected argument before actual one.\n  *Risky: when original PHPUnit methods are overwritten.*\n```diff\n \u003c?php\n class FooTest extends TestCase {\n     public function testFoo() {\n-        self::assertSame($value, 10);\n+        self::assertSame(10, $value);\n     }\n }\n```\n\n#### PhpUnitDedicatedAssertFixer\nPHPUnit assertions like `assertCount` and `assertInstanceOf` must be used over `assertEquals`/`assertSame`.\n  *Risky: when original PHPUnit methods are overwritten.*\n```diff\n \u003c?php\n class FooTest extends TestCase {\n     public function testFoo() {\n-        self::assertSame($size, count($elements));\n-        self::assertSame($className, get_class($object));\n+        self::assertCount($size, $elements);\n+        self::assertInstanceOf($className, $object);\n     }\n }\n```\n\n#### PhpUnitNoUselessReturnFixer\nPHPUnit `fail`, `markTestIncomplete` and `markTestSkipped` functions must not be directly followed by `return`.\n  *Risky: when original PHPUnit methods are overwritten.*\n```diff\n \u003c?php\n class FooTest extends TestCase {\n     public function testFoo() {\n         $this-\u003emarkTestSkipped();\n-        return;\n     }\n }\n```\n\n#### PhpUnitRequiresConstraintFixer\nAssertions and attributes for PHP and PHPUnit versions must have explicit version constraint and space after comparison operator.\n```diff\n \u003c?php\n class MyTest extends TestCase {\n     /**\n-     * @requires PHP 8.1\n+     * @requires PHP \u003e= 8.1\n      */\n     public function testFoo() {}\n \n     /**\n-     * @requires PHP \u003c8.3\n+     * @requires PHP \u003c 8.3\n      */\n     public function testBar() {}\n \n-    #[\\PHPUnit\\Framework\\Attributes\\RequiresPhpunit('12.0')]\n+    #[\\PHPUnit\\Framework\\Attributes\\RequiresPhpunit('\u003e= 12.0')]\n     public function testBaz() {}\n }\n```\n\n#### PhpdocArrayStyleFixer\nGeneric array style should be used in PHPDoc.\n  DEPRECATED: use `phpdoc_array_type` instead.\n```diff\n \u003c?php\n /**\n- * @return int[]\n+ * @return array\u003cint\u003e\n  */\n  function foo() { return [1, 2]; }\n```\n\n#### PhpdocNoIncorrectVarAnnotationFixer\nThe `@var` annotations must be used correctly in code.\n```diff\n \u003c?php\n-/** @var Foo $foo */\n $bar = new Foo();\n```\n\n#### PhpdocNoSuperfluousParamFixer\nThere must be no superfluous parameters in PHPDoc.\n```diff\n \u003c?php\n /**\n  * @param bool $b\n- * @param int $i\n  * @param string $s this is string\n- * @param string $s duplicated\n  */\n function foo($b, $s) {}\n```\n\n#### PhpdocOnlyAllowedAnnotationsFixer\nOnly the listed annotations are allowed in PHPDoc.\nConfiguration options:\n- `elements` (`array`): list of annotations to keep in PHPDoc; defaults to `[]`\n```diff\n \u003c?php\n /**\n  * @author John Doe\n- * @package foo\n- * @subpackage bar\n  * @version 1.0\n  */\n function foo_bar() {}\n```\n\n#### PhpdocParamOrderFixer\nOrders all `@param` annotations in DocBlocks according to method signature.\n  DEPRECATED: use `phpdoc_param_order` instead.\n```diff\n \u003c?php\n /**\n+ * @param int $a\n  * @param int $b\n- * @param int $a\n  * @param int $c\n  */\n function foo($a, $b, $c) {}\n```\n\n#### PhpdocParamTypeFixer\nThe `@param` annotations must have a type.\n```diff\n \u003c?php\n /**\n  * @param string $foo\n- * @param        $bar\n+ * @param mixed  $bar\n  */\n function a($foo, $bar) {}\n```\n\n#### PhpdocSelfAccessorFixer\nIn PHPDoc, the class or interface element `self` must be used instead of the class name itself.\n```diff\n \u003c?php\n class Foo {\n     /**\n-     * @var Foo\n+     * @var self\n      */\n      private $instance;\n }\n```\n\n#### PhpdocSingleLineVarFixer\nThe `@var` annotation must be on a single line if it is the only content.\n```diff\n \u003c?php\n class Foo {\n-    /**\n-     * @var string\n-     */\n+    /** @var string */\n     private $name;\n }\n```\n\n#### PhpdocTypeListFixer\nPHPDoc type `list` must be used instead of `array` without a key type.\n  DEPRECATED: use `phpdoc_list_type` instead.\n```diff\n \u003c?php\n /**\n- * @param array\u003cstring\u003e\n+ * @param list\u003cstring\u003e\n  */\n function foo($x) {}\n```\n\n#### PhpdocTypesCommaSpacesFixer\nPHPDoc types commas must not be preceded by a whitespace, and must be succeeded by a single whitespace.\n```diff\n-\u003c?php /** @var array\u003cint,string\u003e */\n+\u003c?php /** @var array\u003cint, string\u003e */\n```\n\n#### PhpdocTypesTrimFixer\nPHPDoc types must be trimmed.\n```diff\n \u003c?php\n /**\n- * @param null | string $x\n+ * @param null|string $x\n  */\n function foo($x) {}\n```\n\n#### PhpdocVarAnnotationToAssertFixer\nConverts `@var` annotations to `assert` calls when used in assignments.\n```diff\n \u003c?php\n-/** @var string $x */\n $x = getValue();\n+assert(is_string($x));\n```\n\n#### PromotedConstructorPropertyFixer\nConstructor properties must be promoted if possible.\nConfiguration options:\n- `promote_only_existing_properties` (`bool`): whether to promote only properties that are defined in class; defaults to `false`\n```diff\n \u003c?php\n class Foo {\n-    private string $bar;\n-    public function __construct(string $bar) {\n-        $this-\u003ebar = $bar;\n+    public function __construct(private string $bar) {\n     }\n }\n```\n\n#### ReadonlyPromotedPropertiesFixer\nPromoted properties must be declared as read-only.\n  *Risky: when property is written.*\n```diff\n \u003c?php class Foo {\n     public function __construct(\n-        public array $a,\n-        public bool $b,\n+        public readonly array $a,\n+        public readonly bool $b,\n     ) {}\n }\n```\n\n#### SingleSpaceAfterStatementFixer\nStatements not followed by a semicolon must be followed by a single space.\nConfiguration options:\n- `allow_linebreak` (`bool`): whether to allow statement followed by linebreak; defaults to `false`\n```diff\n \u003c?php\n-$foo = new    Foo();\n-echo$foo-\u003ebar();\n+$foo = new Foo();\n+echo $foo-\u003ebar();\n```\n\n#### SingleSpaceBeforeStatementFixer\nStatements not preceded by a line break must be preceded by a single space.\n```diff\n \u003c?php\n-$foo =new Foo();\n+$foo = new Foo();\n```\n\n#### StringableInterfaceFixer\nA class that implements the `__toString()` method must explicitly implement the `Stringable` interface.\n```diff\n \u003c?php\n-class Foo\n+class Foo implements \\Stringable\n {\n    public function __toString()\n    {\n         return \"Foo\";\n    }\n }\n```\n\n#### TrimKeyFixer\nThe string key of an array or generator must be trimmed and have no double spaces.\n```diff\n \u003c?php\n $array = [\n-    'option 1 ' =\u003e 'v1',\n-    'option 2  or 3' =\u003e 'v23',\n+    'option 1' =\u003e 'v1',\n+    'option 2 or 3' =\u003e 'v23',\n ];\n```\n\n\n## Contributing\nRequest a feature or report a bug by creating an [issue](https://github.com/kubawerlos/php-cs-fixer-custom-fixers/issues).\n\nAlternatively, fork the repository, commit your changes, and make sure everything is fine:\n```bash\ncomposer verify\n```\nand submit a pull request.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkubawerlos%2Fphp-cs-fixer-custom-fixers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkubawerlos%2Fphp-cs-fixer-custom-fixers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkubawerlos%2Fphp-cs-fixer-custom-fixers/lists"}