File tree Expand file tree Collapse file tree 11 files changed +3973
-1354
lines changed Expand file tree Collapse file tree 11 files changed +3973
-1354
lines changed Original file line number Diff line number Diff line change 1+ name : Actions CI
2+
3+ on : ['push', 'pull_request']
4+
5+ jobs :
6+ testsuite :
7+ runs-on : ubuntu-20.04
8+ strategy :
9+ fail-fast : false
10+ matrix :
11+ php-version : ['7.4', '8.0', '8.1']
12+
13+ steps :
14+ - uses : actions/checkout@v2
15+
16+ - name : Setup PHP
17+ uses : shivammathur/setup-php@v2
18+ with :
19+ php-version : ${{ matrix.php-version }}
20+ ini-values : memory_limit=512M, xdebug.mode=off
21+ coverage : pcov
22+
23+ - name : Get composer cache directory
24+ id : composer-cache
25+ run : echo "::set-output name=dir::$(composer config cache-files-dir)"
26+
27+ - name : Get date part for cache key
28+ id : key-date
29+ run : echo "::set-output name=date::$(date +'%Y-%m')"
30+
31+ - name : Cache composer dependencies
32+ uses : actions/cache@v1
33+ with :
34+ path : ${{ steps.composer-cache.outputs.dir }}
35+ key : ${{ runner.os }}-composer-${{ steps.key-date.outputs.date }}-${{ hashFiles('composer.json') }}
36+
37+ - name : Composer install
38+ run : composer update --no-interaction --prefer-dist --no-progress
39+
40+ - name : Run tests
41+ run : |
42+ if [[ ${{ matrix.php-version }} == '7.4' ]]; then
43+ export CODECOVERAGE=1 && vendor/bin/phpunit --verbose --coverage-clover=coverage.xml
44+ else
45+ vendor/bin/phpunit
46+ fi
47+
48+ - name : Submit code coverage
49+ if : matrix.php-version == '7.4'
50+ uses : codecov/codecov-action@v1
Original file line number Diff line number Diff line change 1- /vendor
21/composer.phar
3- /phpdoc-checker.phar
4- /.php_cs.cache
2+ /composer.lock
3+
4+ /vendor
5+
6+ /.php-cs-fixer.cache
7+ /.phpunit.result.cache
8+
9+ /tests /var /log /* .log
10+ /tests /var /coverage
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ use PhpCsFixer \Config ;
4+
5+ $ finder = PhpCsFixer \Finder::create ()
6+ ->name ('*.php ' )
7+ ->ignoreDotFiles (true )
8+ ->ignoreVCS (true )
9+ ->exclude (['vendor ' ])
10+ ->in (__DIR__ )
11+ ;
12+
13+ $ config = new Config ();
14+
15+ return $ config
16+ ->setRules ([
17+ '@PSR1 ' => true ,
18+ '@PSR12 ' => true ,
19+ 'strict_param ' => true ,
20+ 'array_syntax ' => ['syntax ' => 'short ' ],
21+ 'blank_line_before_statement ' => ['statements ' => ['return ' , 'throw ' ]],
22+ 'general_phpdoc_tag_rename ' => ['replacements ' => [
23+ 'inheritDocs ' => 'inheritDoc ' ,
24+ 'inheritdocs ' => 'inheritDoc ' ,
25+ 'inheritdoc ' => 'inheritDoc ' ,
26+ ]],
27+ 'no_superfluous_phpdoc_tags ' => [
28+ 'allow_mixed ' => true ,
29+ 'allow_unused_params ' => true ,
30+ ],
31+ 'no_unneeded_curly_braces ' => [
32+ 'namespaces ' => true ,
33+ ],
34+ 'phpdoc_types_order ' => [
35+ 'null_adjustment ' => 'always_last ' ,
36+ ],
37+ ])
38+ ->setIndent (' ' )
39+ ->setLineEnding ("\n" )
40+ ->setFinder ($ finder )
41+ ;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ PHP? =php7.4
2+ COMPOSER =/usr/local/bin/composer
3+
4+ php-info :
5+ @echo " Default PHP version: $( PHP) (Run with custom PHP version: make install PHP=php8.0).\n" ;
6+
7+ list : php-info # # List
8+ @sed -rn ' s/^([a-zA-Z_-]+):.*?## (.*)$$/"\1" "\2"/p' < $(MAKEFILE_LIST ) | xargs printf " %-20s%s\n"
9+
10+ install : php-info # # Install dependencies (make install PHP=php8.0)
11+ @if [ ! -d " vendor" ]; then $(PHP ) $(COMPOSER ) install; fi ;
12+
13+ install-force : php-info # # Force install dependencies (make install PHP=php8.0)
14+ $(PHP ) $(COMPOSER ) install
15+
16+ update : php-info # # Update dependencies
17+ @$(PHP ) $(COMPOSER ) update
18+
19+ test : php-info install # # Run PHPUnit tests
20+ $(PHP ) vendor/bin/phpunit --configuration=phpunit.xml.dist
21+
22+ test-coverage : php-info install # # Run PHPUnit tests with coverage report
23+ $(PHP ) vendor/bin/phpunit --configuration=phpunit.xml.dist --coverage-text --coverage-html=tests/var/coverage
24+
25+ mutation-test : php-info install # # Run Infection mutation tests
26+ $(PHP ) vendor/bin/infection --threads=4 --show-mutations -vvv
27+
28+ code-style-fix : php-info install # # Fix code style
29+ $(PHP ) vendor/bin/php-cs-fixer fix --allow-risky=yes --diff
30+
31+ psalm : php-info install # # Run Psalm check
32+ $(PHP ) vendor/bin/psalm --config=psalm.xml.dist --threads=4 --show-snippet=true --show-info=true
33+
34+ .PHONY : php-info list install install-force update test test-coverage mutation-test code-style-fix psalm
35+ .DEFAULT_GOAL := list
Original file line number Diff line number Diff line change 1+ coverage :
2+ round : nearest
3+ precision : 2
4+
5+ github_checks :
6+ annotations : false
7+
8+ comment : false
9+
10+ ignore :
11+ - " tests"
12+ - " vendor"
Original file line number Diff line number Diff line change 4242 "symfony/console" : " ^4.4|^5.0"
4343 },
4444 "require-dev" : {
45- "phpunit/phpunit" : " ^7.5" ,
46- "phpmd/phpmd" : " ^2.10" ,
47- "sebastian/phpcpd" : " ^5.0" ,
48- "squizlabs/php_codesniffer" : " ^3.6" ,
49- "phploc/phploc" : " ^2.0" ,
50- "jakub-onderka/php-parallel-lint" : " ^1.0"
45+ "phpunit/phpunit" : " ^9.5" ,
46+ "friendsofphp/php-cs-fixer" : " ^3.4" ,
47+ "infection/infection" : " ^0.25" ,
48+ "vimeo/psalm" : " ^4.16" ,
49+ "phpmd/phpmd" : " ^2.10" ,
50+ "sebastian/phpcpd" : " ^6.0" ,
51+ "phploc/phploc" : " ^7.0" ,
52+ "php-parallel-lint/php-parallel-lint" : " ^1.3"
5153 },
5254 "bin" : [
5355 " bin/phpdoc-checker"
54- ]
56+ ],
57+ "config" : {
58+ "allow-plugins" : {
59+ "infection/extension-installer" : true
60+ }
61+ }
5562}
You can’t perform that action at this time.
0 commit comments