-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
141 additions
and
59 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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Code Quality | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: ~ | ||
|
||
jobs: | ||
test-php-80: | ||
name: Code quality PHP 8.0 | ||
runs-on: [ubuntu-latest] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 8.0 | ||
coverage: xdebug | ||
|
||
- name: Validate composer.json and composer.lock | ||
run: composer validate --strict | ||
|
||
- name: Install dependencies | ||
run: composer install --prefer-dist --no-progress | ||
|
||
- name: Lint | ||
run: composer lint:check | ||
|
||
- name: PHP Static Analysis | ||
run: composer phpstan | ||
|
||
- name: Unit Test | ||
run: composer phpunit |
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 |
---|---|---|
|
@@ -2,5 +2,7 @@ | |
/.idea | ||
/bin | ||
.php_cs.cache | ||
.php-cs-fixer.cache | ||
.phpunit.result.cache | ||
/composer.lock | ||
/coverage.xml |
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,63 @@ | ||
<?php | ||
|
||
$finder = PhpCsFixer\Finder::create() | ||
->in(__DIR__ . '/src') | ||
->in(__DIR__ . '/tests'); | ||
|
||
$config = new PhpCsFixer\Config(); | ||
$config | ||
->setRules([ | ||
'@Symfony' => true, | ||
'@PHP71Migration:risky' => true, | ||
'@PHPUnit60Migration:risky' => true, | ||
'array_indentation' => true, | ||
'array_syntax' => ['syntax' => 'short'], | ||
'blank_line_after_opening_tag' => true, | ||
'concat_space' => ['spacing' => 'one'], | ||
'class_attributes_separation' => ['elements' => ['method'=>'one']], | ||
'declare_strict_types' => true, | ||
'increment_style' => ['style' => 'post'], | ||
'list_syntax' => ['syntax' => 'short'], | ||
'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline'], | ||
'method_chaining_indentation' => true, | ||
'modernize_types_casting' => true, | ||
'multiline_whitespace_before_semicolons' => true, | ||
'no_superfluous_elseif' => true, | ||
'no_superfluous_phpdoc_tags' => false, | ||
'no_useless_else' => true, | ||
'no_useless_return' => true, | ||
'ordered_imports' => true, | ||
'phpdoc_align' => false, | ||
'phpdoc_order' => true, | ||
'php_unit_construct' => true, | ||
'php_unit_dedicate_assert' => true, | ||
'return_assignment' => true, | ||
'single_blank_line_at_eof' => true, | ||
'single_line_comment_style' => true, | ||
'ternary_to_null_coalescing' => true, | ||
'yoda_style' => ['equal' => false, 'identical' => false, 'less_and_greater' => false], | ||
'void_return' => true, | ||
]) | ||
->setFinder($finder) | ||
->setUsingCache(true) | ||
->setRiskyAllowed(true); | ||
; | ||
|
||
// special handling of fabbot.io service if it's using too old PHP CS Fixer version | ||
if (false !== getenv('FABBOT_IO')) { | ||
try { | ||
PhpCsFixer\FixerFactory::create() | ||
->registerBuiltInFixers() | ||
->registerCustomFixers($config->getCustomFixers()) | ||
->useRuleSet(new PhpCsFixer\RuleSet($config->getRules())) | ||
; | ||
} catch (PhpCsFixer\ConfigurationException\InvalidConfigurationException $e) { | ||
$config->setRules([]); | ||
} catch (UnexpectedValueException $e) { | ||
$config->setRules([]); | ||
} catch (InvalidArgumentException $e) { | ||
$config->setRules([]); | ||
} | ||
} | ||
|
||
return $config; |
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,5 @@ | ||
parameters: | ||
level: max | ||
checkMissingIterableValueType: false | ||
paths: | ||
- src |
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