-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from genkgo/upgrade
strict types, property/return types, static analysis, php cs, php 8.0+
- Loading branch information
Showing
37 changed files
with
3,710 additions
and
1,022 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,36 @@ | ||
# .github/workflows/code_checks.yaml | ||
name: code check | ||
|
||
on: | ||
pull_request: null | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
tests: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
php: ['8.0', '8.1'] | ||
|
||
name: PHP ${{ matrix.php }} tests | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
extensions: intl, iconv, openssl | ||
coverage: none | ||
|
||
- name: Download dependencies | ||
run: composer update --no-ansi --prefer-stable --prefer-dist --no-interaction --no-progress --no-suggest | ||
|
||
- name: Run tests | ||
run: ./vendor/bin/phpunit -c phpunit.xml | ||
- name: Static analysis for source | ||
run: ./vendor/bin/phpstan analyse -l max src | ||
- name: Static analysis for tests | ||
run: ./vendor/bin/phpstan analyse -l 5 test | ||
- name: Code Style | ||
run: ./vendor/bin/php-cs-fixer fix --dry-run --verbose --config .php-cs-fixer.dist.php ./src ./test |
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,5 +1,5 @@ | ||
/.idea/ | ||
/.settings/ | ||
/vendor/ | ||
/tests/build/ | ||
.project | ||
/test/build/ | ||
/.phpunit.result.cache | ||
/.php-cs-fixer.cache |
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,17 @@ | ||
<?php | ||
return (new PhpCsFixer\Config()) | ||
->setRules([ | ||
'@PSR2' => true, | ||
'array_syntax' => ['syntax' => 'short'], | ||
'declare_strict_types' => true, | ||
'yoda_style' => false, | ||
'native_function_invocation' => ['include' => ['@all']], | ||
'phpdoc_no_package' => true, | ||
'no_empty_phpdoc' => true, | ||
'blank_line_after_namespace' => true, | ||
'blank_line_after_opening_tag' => true, | ||
'no_blank_lines_after_class_opening' => true, | ||
'no_blank_lines_after_phpdoc' => true, | ||
'class_attributes_separation' => ['elements' => ['property' => 'only_if_meta', 'const' => 'only_if_meta']], | ||
]) | ||
->setRiskyAllowed(true); |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,19 +1,33 @@ | ||
{ | ||
"autoload" : { | ||
"psr-4" : { | ||
"Genkgo\\Migrations\\" : [ | ||
"src", | ||
"tests" | ||
] | ||
"Genkgo\\Migrations\\" : ["src"] | ||
} | ||
}, | ||
"autoload-dev" : { | ||
"psr-4" : { | ||
"Genkgo\\TestMigrations\\" : ["test"] | ||
} | ||
}, | ||
"name" : "genkgo/migrations", | ||
"require" : { | ||
"php" : ">=5.5", | ||
"mathiasverraes/classfunctions" : "1.1.0" | ||
"php" : "~8.0.0 || ~8.1.0", | ||
"ext-pdo": "*" | ||
}, | ||
"require-dev" : { | ||
"phpunit/phpunit" : "~4.0", | ||
"phpunit/phpunit-mock-objects" : "2.3.0" | ||
"phpunit/phpunit" : "^9.5.26", | ||
"phpstan/phpstan": "^1.0", | ||
"friendsofphp/php-cs-fixer": "^3.0" | ||
}, | ||
"scripts": { | ||
"test": [ | ||
"./vendor/bin/phpunit -c phpunit.xml", | ||
"./vendor/bin/phpstan analyse -l max ./src/", | ||
"./vendor/bin/phpstan analyse -l 5 ./test/", | ||
"./vendor/bin/php-cs-fixer fix --dry-run --verbose --config .php-cs-fixer.dist.php ./src ./test" | ||
], | ||
"lint": [ | ||
"./vendor/bin/php-cs-fixer fix --verbose --config .php-cs-fixer.dist.php ./src ./test" | ||
] | ||
} | ||
} |
Oops, something went wrong.