Skip to content

Commit

Permalink
feat: php cs fix config
Browse files Browse the repository at this point in the history
  • Loading branch information
rugbymauri committed May 27, 2024
1 parent e25e2f4 commit c371392
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

/** @var $fixerConfig \PhpCsFixer\Config */
return $fixerConfig = require __DIR__. '/vendor/whatwedo/php-coding-standard/config/phpcsfixer-symfony.php';



17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,23 @@ For other configuration options, check out [Simplify/EasyCodingStandard](https:/
* [slevomat/coding-standard](https://github.com/slevomat/coding-standard)


## PHP CS Fixer integration (experimental)

copy the the file [.php-cs-fixer.dist.php](.php-cs-fixer.dist.php) to your project root.

use `vendor/bin/php-cs-fixer check`y

This comment has been minimized.

Copy link
@marcwieland95

marcwieland95 May 27, 2024

Member

Typo



```php
<?php

/** @var $fixerConfig \PhpCsFixer\Config */
return $fixerConfig = require __DIR__. '/vendor/whatwedo/php-coding-standard/config/phpcsfixer-symfony.php';

```



## License

This bundle is under the MIT license. See the complete license in the bundle: [LICENSE](LICENSE)
30 changes: 30 additions & 0 deletions config/phpcsfixer-symfony.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

This comment has been minimized.

Copy link
@tuxes3

tuxes3 Jun 3, 2024

Member

NIT: has the codestyle been run on this file?


$finder = (new PhpCsFixer\Finder())
->in(__DIR__)
->exclude('var')
;

$fixers = [
];

$fixers = array_merge(
iterator_to_array(new whatwedo\PhpCodingStandard\Fixers()),
iterator_to_array(new PhpCsFixerCustomFixers\Fixers()),
);

return (new PhpCsFixer\Config())
->registerCustomFixers($fixers)
->setRules([
'@Symfony' => true,
whatwedo\PhpCodingStandard\Fixer\DumpFixer::name() => true,
PhpCsFixerCustomFixers\Fixer\NoDoctrineMigrationsGeneratedCommentFixer::name() => true,
PhpCsFixerCustomFixers\Fixer\NoImportFromGlobalNamespaceFixer::name() => true,
PhpCsFixerCustomFixers\Fixer\NoNullableBooleanTypeFixer::name() => true,
PhpCsFixerCustomFixers\Fixer\NoPhpStormGeneratedCommentFixer::name() => true,
PhpCsFixerCustomFixers\Fixer\PhpdocSelfAccessorFixer::name() => true,
])
->setRiskyAllowed(true)
->setFinder($finder)

;

0 comments on commit c371392

Please sign in to comment.