-
-
Notifications
You must be signed in to change notification settings - Fork 461
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add PHP-CS-Fixer and phpstan to dev pipeline
- Loading branch information
Showing
14 changed files
with
110 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
/.php_cs.cache | ||
/.php-cs-fixer.cache | ||
/.phpunit.cache | ||
/.phpunit.result.cache | ||
/.idea/ | ||
/build/ | ||
/vendor/ | ||
composer.lock | ||
composer.phar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?php | ||
|
||
use PhpCsFixer\Config; | ||
use PhpCsFixer\Finder; | ||
use PhpCsFixer\Runner\Parallel\ParallelConfigFactory; | ||
|
||
$finder = (new Finder()) | ||
->in(__DIR__); | ||
|
||
return (new Config()) | ||
->setParallelConfig(ParallelConfigFactory::detect()) | ||
->setRules([ | ||
'@PhpCsFixer' => true, | ||
'@PHP84Migration' => true, | ||
'indentation_type' => true, | ||
|
||
// Overrides for (opinionated) @PhpCsFixer and @Symfony rules: | ||
|
||
// Align "=>" in multi-line array definitions, unless a blank line exists between elements | ||
'binary_operator_spaces' => ['operators' => ['=>' => 'align_single_space_minimal']], | ||
|
||
// Subset of statements that should be proceeded with blank line | ||
'blank_line_before_statement' => ['statements' => ['case', 'continue', 'default', 'return', 'throw', 'try', 'yield', 'yield_from']], | ||
|
||
// Enforce space around concatenation operator | ||
'concat_space' => ['spacing' => 'one'], | ||
|
||
// Use {} for empty loop bodies | ||
'empty_loop_body' => ['style' => 'braces'], | ||
|
||
// Don't change any increment/decrement styles | ||
'increment_style' => false, | ||
|
||
// Forbid multi-line whitespace before the closing semicolon | ||
'multiline_whitespace_before_semicolons' => ['strategy' => 'no_multi_line'], | ||
|
||
// Clean up PHPDocs, but leave @inheritDoc entries alone | ||
'no_superfluous_phpdoc_tags' => ['allow_mixed' => true, 'remove_inheritdoc' => false], | ||
|
||
// Ensure that traits are listed first in classes | ||
// (it would be nice to enforce more, but we'll start simple) | ||
'ordered_class_elements' => ['order' => ['use_trait']], | ||
|
||
// Ensure that param and return types are sorted consistently, with null at end | ||
'phpdoc_types_order' => ['sort_algorithm' => 'alpha', 'null_adjustment' => 'always_last'], | ||
|
||
// Don't add @coversNothing annotations to tests | ||
'php_unit_test_class_requires_covers' => false, | ||
|
||
// Yoda style is too weird | ||
'yoda_style' => false, | ||
]) | ||
->setIndent(' ') | ||
->setLineEnding("\n") | ||
->setFinder($finder); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
includes: | ||
- vendor/larastan/larastan/extension.neon | ||
|
||
parameters: | ||
level: 4 | ||
paths: | ||
- resources | ||
- src | ||
- tests | ||
editorUrl: '%%relFile%%:%%line%%' | ||
editorUrlTitle: '%%relFile%%:%%line%%' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters