From f976aaa495a42d06c120e77b1560bee2fa8574d8 Mon Sep 17 00:00:00 2001 From: Oleg Zhulnev Date: Tue, 16 Nov 2021 11:59:05 +0300 Subject: [PATCH] Support Symfony 6 (#11) * Support Symfony 6 * update static analyze configs * fix pipeline * add more tests * remove php-cs-fixer from composer.json * move all tests under Adapter namespace, add more tests * increase MSI and covered MSI --- .github/workflows/ci.yaml | 21 +- .github/workflows/cs.yaml | 1 - .github/workflows/mt.yaml | 3 +- .gitignore | 2 +- .php_cs.dist => .php-cs-fixer.php | 36 +- .phpstan.neon | 2 + Makefile | 22 +- composer.json | 11 +- composer.lock | 921 ++---------------- infection.json.dist | 3 - phpstan-baseline.neon | 2 +- psalm-baseline.xml | 7 +- src/CodeceptionAdapter.php | 13 + src/CodeceptionConfigParseException.php | 1 + src/CommandLineBuilder.php | 5 + src/Stringifier.php | 2 + src/VersionParser.php | 1 + .../Adapter/CodeceptionAdapterFactoryTest.php | 89 ++ .../{ => Adapter}/CodeceptionAdapterTest.php | 56 +- .../CodeceptionConfigParseExceptionTest.php} | 36 +- .../Coverage/JUnitTestCaseSorterTest.php | 62 ++ .../phpunit/{ => Adapter}/StringifierTest.php | 6 +- tests/phpunit/Adapter/VersionParserTest.php | 110 +++ .../Files/codeception/invalid_codeception.yml | 10 + 24 files changed, 470 insertions(+), 952 deletions(-) rename .php_cs.dist => .php-cs-fixer.php (90%) create mode 100644 tests/phpunit/Adapter/CodeceptionAdapterFactoryTest.php rename tests/phpunit/{ => Adapter}/CodeceptionAdapterTest.php (85%) rename tests/phpunit/{CodeceptionAdapterFactoryTest.php => Adapter/CodeceptionConfigParseExceptionTest.php} (70%) create mode 100644 tests/phpunit/Adapter/Coverage/JUnitTestCaseSorterTest.php rename tests/phpunit/{ => Adapter}/StringifierTest.php (92%) create mode 100644 tests/phpunit/Adapter/VersionParserTest.php create mode 100644 tests/phpunit/Fixtures/Files/codeception/invalid_codeception.yml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a1c9c65..f88a723 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -13,14 +13,19 @@ on: jobs: tests: runs-on: ubuntu-latest + env: + SYMFONY_REQUIRE: ${{ matrix.symfony-require }} strategy: matrix: - operating-system: [ubuntu-latest] php-version: ['7.4', '8.0', '8.1'] coverage-driver: [pcov] + symfony-require: ['^4', '^5', '^6'] + exclude: + - symfony-require: "^6" + php-version: "7.4" - name: CI with PHP ${{ matrix.php-version }}, using ${{ matrix.coverage-driver }} + name: CI with PHP ${{ matrix.php-version }}, using ${{ matrix.coverage-driver }}, with Symfony ${{ matrix.symfony-require }} steps: - name: Checkout @@ -41,15 +46,20 @@ jobs: uses: actions/cache@v2 with: path: ${{ steps.composer-cache.outputs.dir }} - key: composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('composer.*') }} + key: composer-${{ runner.os }}-${{ matrix.php-version }}-${{ matrix.symfony-require }}-${{ hashFiles('composer.*') }} restore-keys: | - composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('composer.*') }}- + composer-${{ runner.os }}-${{ matrix.php-version }}-${{ matrix.symfony-require }}- composer-${{ runner.os }}-${{ matrix.php-version }}- composer-${{ runner.os }}- composer- + - name: Configure Symfony v6@dev hacks + if: matrix.symfony-require == '^6' + run: | + composer config minimum-stability beta + - name: Install dependencies - run: composer install --no-interaction --no-progress --prefer-dist + run: composer update --optimize-autoloader --no-interaction --no-progress --prefer-dist - name: Run tests and generate coverage run: make test-unit @@ -60,6 +70,7 @@ jobs: run: make test-e2e - name: Upload coverage results to Coveralls + if: matrix.symfony-require != '^6' env: COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: vendor/bin/php-coveralls diff --git a/.github/workflows/cs.yaml b/.github/workflows/cs.yaml index b05bbee..513cb2e 100644 --- a/.github/workflows/cs.yaml +++ b/.github/workflows/cs.yaml @@ -42,7 +42,6 @@ jobs: path: ${{ steps.composer-cache.outputs.dir }} key: composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('composer.*') }} restore-keys: | - composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('composer.*') }}- composer-${{ runner.os }}-${{ matrix.php-version }}- composer-${{ runner.os }}- composer- diff --git a/.github/workflows/mt.yaml b/.github/workflows/mt.yaml index 11516d1..54cbb80 100644 --- a/.github/workflows/mt.yaml +++ b/.github/workflows/mt.yaml @@ -41,9 +41,8 @@ jobs: uses: actions/cache@v2 with: path: ${{ steps.composer-cache.outputs.dir }} - key: composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('composer.*') }}-${{ matrix.dependencies }} + key: composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('composer.*') }} restore-keys: | - composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('composer.*') }}- composer-${{ runner.os }}-${{ matrix.php-version }}- composer-${{ runner.os }}- composer- diff --git a/.gitignore b/.gitignore index aee1238..047106e 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,7 @@ .phpunit.result.cache /.composer/ /.idea -/.php_cs.cache +/.php-cs-fixer.cache /.tools/ /build/ /infection.log diff --git a/.php_cs.dist b/.php-cs-fixer.php similarity index 90% rename from .php_cs.dist rename to .php-cs-fixer.php index 32ab740..5d898ff 100644 --- a/.php_cs.dist +++ b/.php-cs-fixer.php @@ -53,18 +53,17 @@ ]) ->ignoreDotFiles(false) ->name('*php') - ->name('.php_cs.dist') ; -return Config::create() +return (new Config()) ->setRiskyAllowed(true) ->setRules([ - '@Symfony' => true, - '@Symfony:risky' => true, '@PHP71Migration' => true, '@PHP71Migration:risky' => true, '@PHPUnit60Migration:risky' => true, '@PHPUnit75Migration:risky' => true, + '@Symfony' => true, + '@Symfony:risky' => true, 'blank_line_before_statement' => [ 'statements' => [ 'break', @@ -88,7 +87,6 @@ ], 'compact_nullable_typehint' => true, 'concat_space' => ['spacing' => 'one'], - 'final_static_access' => true, 'fully_qualified_strict_types' => true, 'global_namespace_import' => [ 'import_classes' => true, @@ -96,7 +94,7 @@ 'import_functions' => true, ], 'header_comment' => [ - 'commentType' => 'PHPDoc', + 'comment_type' => 'PHPDoc', 'header' => $header, 'location' => 'after_open', 'separate' => 'bottom', @@ -105,10 +103,13 @@ 'syntax' => 'short', ], 'logical_operators' => true, - 'native_constant_invocation' => false, - 'native_function_invocation' => false, + 'native_constant_invocation' => true, + 'native_function_invocation' => [ + 'include' => ['@internal'], + ], 'no_alternative_syntax' => true, 'no_superfluous_phpdoc_tags' => true, + 'no_trailing_whitespace_in_string' => false, 'no_unset_cast' => true, 'no_useless_else' => true, 'no_useless_return' => true, @@ -119,24 +120,29 @@ 'phpdoc_align' => [ 'align' => 'left', ], - 'phpdoc_no_empty_return' => true, - 'phpdoc_order' => true, - 'phpdoc_summary' => false, - 'php_unit_set_up_tear_down_visibility' => true, - 'php_unit_strict' => true, 'php_unit_dedicate_assert' => true, 'php_unit_method_casing' => [ 'case' => 'snake_case', ], - 'php_unit_ordered_covers' => true, + 'php_unit_set_up_tear_down_visibility' => true, + 'php_unit_strict' => true, + 'phpdoc_order_by_value' => [ + 'annotations' => ['covers'], + ], 'php_unit_test_annotation' => [ - 'case' => 'snake', 'style' => 'prefix', ], + 'php_unit_test_case_static_method_calls' => [ + 'call_type' => 'this', + ], + 'phpdoc_no_empty_return' => true, + 'phpdoc_order' => true, + 'phpdoc_summary' => false, 'self_static_accessor' => true, 'single_line_throw' => false, 'static_lambda' => true, 'strict_comparison' => true, + 'strict_param' => true, 'yoda_style' => [ 'equal' => false, 'identical' => false, diff --git a/.phpstan.neon b/.phpstan.neon index 68fb19e..dd2e776 100644 --- a/.phpstan.neon +++ b/.phpstan.neon @@ -4,3 +4,5 @@ includes: parameters: level: max inferPrivatePropertyTypeFromConstructor: true + ignoreErrors: + - '#Dynamic call to static method PHPUnit\\Framework\\.*::.*#' diff --git a/Makefile b/Makefile index 793c46f..90bad9d 100644 --- a/Makefile +++ b/Makefile @@ -7,9 +7,8 @@ PHP=$(shell which php) JOBS=$(shell nproc) # PHP CS Fixer -PHP_CS_FIXER=vendor/bin/php-cs-fixer -PHP_CS_FIXER_ARGS=--diff --diff-format=udiff --verbose -export PHP_CS_FIXER_IGNORE_ENV=1 +PHP_CS_FIXER=./.tools/php-cs-fixer +PHP_CS_FIXER_URL="https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v3.2.1/php-cs-fixer.phar" # PHPUnit PHPUNIT=vendor/bin/phpunit @@ -30,14 +29,14 @@ COMPOSER=$(PHP) $(shell which composer) # Infection INFECTION=./.tools/infection.phar INFECTION_URL="https://github.com/infection/infection/releases/download/0.24.0/infection.phar" -MIN_MSI=78 -MIN_COVERED_MSI=98 -INFECTION_ARGS=--min-msi=$(MIN_MSI) --min-covered-msi=$(MIN_COVERED_MSI) --threads=$(JOBS) --log-verbosity=none --no-interaction --no-progress +MIN_MSI=87 +MIN_COVERED_MSI=99 +INFECTION_ARGS=--min-msi=$(MIN_MSI) --min-covered-msi=$(MIN_COVERED_MSI) --threads=$(JOBS) --log-verbosity=none --no-interaction --no-progress --show-mutations all: test -cs: - $(PHP_CS_FIXER) fix $(PHP_CS_FIXER_ARGS) --dry-run +cs: $(PHP_CS_FIXER) + $(PHP_CS_FIXER) fix -v --diff --dry-run LC_ALL=C sort -u .gitignore -o .gitignore phpstan: @@ -79,7 +78,7 @@ analyze: cs-fix $(PSALM) $(PSALM_ARGS) cs-fix: test-prerequisites - $(PHP_CS_FIXER) fix $(PHP_CS_FIXER_ARGS) + $(PHP_CS_FIXER) fix -v --diff LC_ALL=C sort -u .gitignore -o .gitignore ############################################################## @@ -106,3 +105,8 @@ $(INFECTION): Makefile wget -q $(INFECTION_URL) --output-document=$(INFECTION) chmod a+x $(INFECTION) touch $@ + +$(PHP_CS_FIXER): Makefile + wget -q $(PHP_CS_FIXER_URL) --output-document=$(PHP_CS_FIXER) + chmod a+x $(PHP_CS_FIXER) + touch $@ diff --git a/composer.json b/composer.json index efbbeaa..4cdea85 100644 --- a/composer.json +++ b/composer.json @@ -29,9 +29,9 @@ "php": "^7.4 || ^8.0", "infection/abstract-testframework-adapter": "^0.5.0", "infection/include-interceptor": "^0.2.0", - "symfony/filesystem": "^3.4.29 || ^4.0 || ^5.0", - "symfony/process": "^3.4.29 || ^4.0 || ^5.0", - "symfony/yaml": "^3.4.29 || ^4.0 || ^5.0" + "symfony/filesystem": "^4.4 || ^5.0 || ^6.0", + "symfony/process": "^4.4 || ^5.0 || ^6.0", + "symfony/yaml": "^4.4 || ^5.0 || ^6.0" }, "extra": { "infection": { @@ -39,8 +39,7 @@ } }, "require-dev": { - "friendsofphp/php-cs-fixer": "^2.18", - "php-coveralls/php-coveralls": "^2.4", + "php-coveralls/php-coveralls": "^2.5", "phpstan/extension-installer": "^1.1", "phpstan/phpstan": "^0.12.70", "phpstan/phpstan-phpunit": "^0.12.17", @@ -48,7 +47,7 @@ "phpstan/phpstan-webmozart-assert": "^0.12.9", "phpunit/phpunit": "^9.5", "thecodingmachine/safe": "^1.3", - "vimeo/psalm": "^4.4" + "vimeo/psalm": "^4.12" }, "conflict": { "codeception/codeception": "<4.1.9" diff --git a/composer.lock b/composer.lock index c498dff..c373558 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "e70abb95ff1fe9887a7a4b329977ff4d", + "content-hash": "53c166cf8041ed29e115c07d685fc52f", "packages": [ { "name": "infection/abstract-testframework-adapter", @@ -176,21 +176,22 @@ }, { "name": "symfony/filesystem", - "version": "v5.2.2", + "version": "v5.3.4", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "262d033b57c73e8b59cd6e68a45c528318b15038" + "reference": "343f4fe324383ca46792cae728a3b6e2f708fb32" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/262d033b57c73e8b59cd6e68a45c528318b15038", - "reference": "262d033b57c73e8b59cd6e68a45c528318b15038", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/343f4fe324383ca46792cae728a3b6e2f708fb32", + "reference": "343f4fe324383ca46792cae728a3b6e2f708fb32", "shasum": "" }, "require": { "php": ">=7.2.5", - "symfony/polyfill-ctype": "~1.8" + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-php80": "^1.16" }, "type": "library", "autoload": { @@ -218,7 +219,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v5.2.2" + "source": "https://github.com/symfony/filesystem/tree/v5.3.4" }, "funding": [ { @@ -234,7 +235,7 @@ "type": "tidelift" } ], - "time": "2021-01-27T10:01:46+00:00" + "time": "2021-07-21T12:40:44+00:00" }, { "name": "symfony/polyfill-ctype", @@ -400,21 +401,21 @@ }, { "name": "symfony/process", - "version": "v5.2.2", + "version": "v5.3.7", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "313a38f09c77fbcdc1d223e57d368cea76a2fd2f" + "reference": "38f26c7d6ed535217ea393e05634cb0b244a1967" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/313a38f09c77fbcdc1d223e57d368cea76a2fd2f", - "reference": "313a38f09c77fbcdc1d223e57d368cea76a2fd2f", + "url": "https://api.github.com/repos/symfony/process/zipball/38f26c7d6ed535217ea393e05634cb0b244a1967", + "reference": "38f26c7d6ed535217ea393e05634cb0b244a1967", "shasum": "" }, "require": { "php": ">=7.2.5", - "symfony/polyfill-php80": "^1.15" + "symfony/polyfill-php80": "^1.16" }, "type": "library", "autoload": { @@ -442,7 +443,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v5.2.2" + "source": "https://github.com/symfony/process/tree/v5.3.7" }, "funding": [ { @@ -458,20 +459,20 @@ "type": "tidelift" } ], - "time": "2021-01-27T10:15:41+00:00" + "time": "2021-08-04T21:20:46+00:00" }, { "name": "symfony/yaml", - "version": "v5.2.2", + "version": "v5.3.6", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "6bb8b36c6dea8100268512bf46e858c8eb5c545e" + "reference": "4500fe63dc9c6ffc32d3b1cb0448c329f9c814b7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/6bb8b36c6dea8100268512bf46e858c8eb5c545e", - "reference": "6bb8b36c6dea8100268512bf46e858c8eb5c545e", + "url": "https://api.github.com/repos/symfony/yaml/zipball/4500fe63dc9c6ffc32d3b1cb0448c329f9c814b7", + "reference": "4500fe63dc9c6ffc32d3b1cb0448c329f9c814b7", "shasum": "" }, "require": { @@ -517,7 +518,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v5.2.2" + "source": "https://github.com/symfony/yaml/tree/v5.3.6" }, "funding": [ { @@ -533,7 +534,7 @@ "type": "tidelift" } ], - "time": "2021-01-27T10:01:46+00:00" + "time": "2021-07-29T06:20:01+00:00" } ], "packages-dev": [ @@ -951,81 +952,6 @@ }, "time": "2019-12-04T15:06:13+00:00" }, - { - "name": "doctrine/annotations", - "version": "1.11.1", - "source": { - "type": "git", - "url": "https://github.com/doctrine/annotations.git", - "reference": "ce77a7ba1770462cd705a91a151b6c3746f9c6ad" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/ce77a7ba1770462cd705a91a151b6c3746f9c6ad", - "reference": "ce77a7ba1770462cd705a91a151b6c3746f9c6ad", - "shasum": "" - }, - "require": { - "doctrine/lexer": "1.*", - "ext-tokenizer": "*", - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "doctrine/cache": "1.*", - "doctrine/coding-standard": "^6.0 || ^8.1", - "phpstan/phpstan": "^0.12.20", - "phpunit/phpunit": "^7.5 || ^9.1.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.11.x-dev" - } - }, - "autoload": { - "psr-4": { - "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Docblock Annotations Parser", - "homepage": "https://www.doctrine-project.org/projects/annotations.html", - "keywords": [ - "annotations", - "docblock", - "parser" - ], - "support": { - "issues": "https://github.com/doctrine/annotations/issues", - "source": "https://github.com/doctrine/annotations/tree/1.11.1" - }, - "time": "2020-10-26T10:28:16+00:00" - }, { "name": "doctrine/instantiator", "version": "1.4.0", @@ -1095,86 +1021,6 @@ ], "time": "2020-11-10T18:47:58+00:00" }, - { - "name": "doctrine/lexer", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/doctrine/lexer.git", - "reference": "e864bbf5904cb8f5bb334f99209b48018522f042" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/e864bbf5904cb8f5bb334f99209b48018522f042", - "reference": "e864bbf5904cb8f5bb334f99209b48018522f042", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "require-dev": { - "doctrine/coding-standard": "^6.0", - "phpstan/phpstan": "^0.11.8", - "phpunit/phpunit": "^8.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "autoload": { - "psr-4": { - "Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", - "homepage": "https://www.doctrine-project.org/projects/lexer.html", - "keywords": [ - "annotations", - "docblock", - "lexer", - "parser", - "php" - ], - "support": { - "issues": "https://github.com/doctrine/lexer/issues", - "source": "https://github.com/doctrine/lexer/tree/1.2.1" - }, - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Flexer", - "type": "tidelift" - } - ], - "time": "2020-05-25T17:44:05+00:00" - }, { "name": "felixfbecker/advanced-json-rpc", "version": "v3.2.0", @@ -1276,109 +1122,6 @@ }, "time": "2020-10-23T13:55:30+00:00" }, - { - "name": "friendsofphp/php-cs-fixer", - "version": "v2.18.2", - "source": { - "type": "git", - "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", - "reference": "18f8c9d184ba777380794a389fabc179896ba913" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/18f8c9d184ba777380794a389fabc179896ba913", - "reference": "18f8c9d184ba777380794a389fabc179896ba913", - "shasum": "" - }, - "require": { - "composer/semver": "^1.4 || ^2.0 || ^3.0", - "composer/xdebug-handler": "^1.2", - "doctrine/annotations": "^1.2", - "ext-json": "*", - "ext-tokenizer": "*", - "php": "^5.6 || ^7.0 || ^8.0", - "php-cs-fixer/diff": "^1.3", - "symfony/console": "^3.4.43 || ^4.1.6 || ^5.0", - "symfony/event-dispatcher": "^3.0 || ^4.0 || ^5.0", - "symfony/filesystem": "^3.0 || ^4.0 || ^5.0", - "symfony/finder": "^3.0 || ^4.0 || ^5.0", - "symfony/options-resolver": "^3.0 || ^4.0 || ^5.0", - "symfony/polyfill-php70": "^1.0", - "symfony/polyfill-php72": "^1.4", - "symfony/process": "^3.0 || ^4.0 || ^5.0", - "symfony/stopwatch": "^3.0 || ^4.0 || ^5.0" - }, - "require-dev": { - "justinrainbow/json-schema": "^5.0", - "keradus/cli-executor": "^1.4", - "mikey179/vfsstream": "^1.6", - "php-coveralls/php-coveralls": "^2.4.2", - "php-cs-fixer/accessible-object": "^1.0", - "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.2", - "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.2.1", - "phpspec/prophecy-phpunit": "^1.1 || ^2.0", - "phpunit/phpunit": "^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.13 || ^9.5", - "phpunitgoodpractices/polyfill": "^1.5", - "phpunitgoodpractices/traits": "^1.9.1", - "sanmai/phpunit-legacy-adapter": "^6.4 || ^8.2.1", - "symfony/phpunit-bridge": "^5.2.1", - "symfony/yaml": "^3.0 || ^4.0 || ^5.0" - }, - "suggest": { - "ext-dom": "For handling output formats in XML", - "ext-mbstring": "For handling non-UTF8 characters.", - "php-cs-fixer/phpunit-constraint-isidenticalstring": "For IsIdenticalString constraint.", - "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "For XmlMatchesXsd constraint.", - "symfony/polyfill-mbstring": "When enabling `ext-mbstring` is not possible." - }, - "bin": [ - "php-cs-fixer" - ], - "type": "application", - "autoload": { - "psr-4": { - "PhpCsFixer\\": "src/" - }, - "classmap": [ - "tests/Test/AbstractFixerTestCase.php", - "tests/Test/AbstractIntegrationCaseFactory.php", - "tests/Test/AbstractIntegrationTestCase.php", - "tests/Test/Assert/AssertTokensTrait.php", - "tests/Test/IntegrationCase.php", - "tests/Test/IntegrationCaseFactory.php", - "tests/Test/IntegrationCaseFactoryInterface.php", - "tests/Test/InternalIntegrationCaseFactory.php", - "tests/Test/IsIdenticalConstraint.php", - "tests/TestCase.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Dariusz RumiƄski", - "email": "dariusz.ruminski@gmail.com" - } - ], - "description": "A tool to automatically fix PHP code style", - "support": { - "issues": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues", - "source": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/tree/v2.18.2" - }, - "funding": [ - { - "url": "https://github.com/keradus", - "type": "github" - } - ], - "time": "2021-01-26T00:22:21+00:00" - }, { "name": "guzzlehttp/guzzle", "version": "7.2.0", @@ -1942,16 +1685,16 @@ }, { "name": "php-coveralls/php-coveralls", - "version": "v2.4.3", + "version": "v2.5.1", "source": { "type": "git", "url": "https://github.com/php-coveralls/php-coveralls.git", - "reference": "909381bd40a17ae6e9076051f0d73293c1c091af" + "reference": "a54881adfb9bb3a01ca72e2832131b33f02da4e4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-coveralls/php-coveralls/zipball/909381bd40a17ae6e9076051f0d73293c1c091af", - "reference": "909381bd40a17ae6e9076051f0d73293c1c091af", + "url": "https://api.github.com/repos/php-coveralls/php-coveralls/zipball/a54881adfb9bb3a01ca72e2832131b33f02da4e4", + "reference": "a54881adfb9bb3a01ca72e2832131b33f02da4e4", "shasum": "" }, "require": { @@ -1959,11 +1702,11 @@ "ext-simplexml": "*", "guzzlehttp/guzzle": "^6.0 || ^7.0", "php": "^5.5 || ^7.0 || ^8.0", - "psr/log": "^1.0", - "symfony/config": "^2.1 || ^3.0 || ^4.0 || ^5.0", - "symfony/console": "^2.1 || ^3.0 || ^4.0 || ^5.0", - "symfony/stopwatch": "^2.0 || ^3.0 || ^4.0 || ^5.0", - "symfony/yaml": "^2.0.5 || ^3.0 || ^4.0 || ^5.0" + "psr/log": "^1.0 || ^2.0", + "symfony/config": "^2.1 || ^3.0 || ^4.0 || ^5.0 || ^6.0", + "symfony/console": "^2.1 || ^3.0 || ^4.0 || ^5.0 || ^6.0", + "symfony/stopwatch": "^2.0 || ^3.0 || ^4.0 || ^5.0 || ^6.0", + "symfony/yaml": "^2.0.5 || ^3.0 || ^4.0 || ^5.0 || ^6.0" }, "require-dev": { "phpunit/phpunit": "^4.8.35 || ^5.4.3 || ^6.0 || ^7.0 || ^8.0 || ^9.0", @@ -2019,64 +1762,9 @@ ], "support": { "issues": "https://github.com/php-coveralls/php-coveralls/issues", - "source": "https://github.com/php-coveralls/php-coveralls/tree/v2.4.3" - }, - "time": "2020-12-24T09:17:03+00:00" - }, - { - "name": "php-cs-fixer/diff", - "version": "v1.3.1", - "source": { - "type": "git", - "url": "https://github.com/PHP-CS-Fixer/diff.git", - "reference": "dbd31aeb251639ac0b9e7e29405c1441907f5759" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/diff/zipball/dbd31aeb251639ac0b9e7e29405c1441907f5759", - "reference": "dbd31aeb251639ac0b9e7e29405c1441907f5759", - "shasum": "" + "source": "https://github.com/php-coveralls/php-coveralls/tree/v2.5.1" }, - "require": { - "php": "^5.6 || ^7.0 || ^8.0" - }, - "require-dev": { - "phpunit/phpunit": "^5.7.23 || ^6.4.3 || ^7.0", - "symfony/process": "^3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - }, - { - "name": "SpacePossum" - } - ], - "description": "sebastian/diff v2 backport support for PHP5.6", - "homepage": "https://github.com/PHP-CS-Fixer", - "keywords": [ - "diff" - ], - "support": { - "issues": "https://github.com/PHP-CS-Fixer/diff/issues", - "source": "https://github.com/PHP-CS-Fixer/diff/tree/v1.3.1" - }, - "time": "2020-10-14T08:39:05+00:00" + "time": "2021-11-10T16:53:56+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -3043,56 +2731,6 @@ }, "time": "2017-02-14T16:28:37+00:00" }, - { - "name": "psr/event-dispatcher", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/event-dispatcher.git", - "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", - "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", - "shasum": "" - }, - "require": { - "php": ">=7.2.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\EventDispatcher\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Standard interfaces for event handling.", - "keywords": [ - "events", - "psr", - "psr-14" - ], - "support": { - "issues": "https://github.com/php-fig/event-dispatcher/issues", - "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" - }, - "time": "2019-01-08T18:20:26+00:00" - }, { "name": "psr/http-client", "version": "1.0.1", @@ -4433,323 +4071,29 @@ "time": "2021-01-27T10:15:41+00:00" }, { - "name": "symfony/event-dispatcher", - "version": "v5.2.2", + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.22.0", "source": { "type": "git", - "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "4f9760f8074978ad82e2ce854dff79a71fe45367" + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "267a9adeb8ecb8071040a740930e077cdfb987af" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/4f9760f8074978ad82e2ce854dff79a71fe45367", - "reference": "4f9760f8074978ad82e2ce854dff79a71fe45367", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/267a9adeb8ecb8071040a740930e077cdfb987af", + "reference": "267a9adeb8ecb8071040a740930e077cdfb987af", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1", - "symfony/event-dispatcher-contracts": "^2", - "symfony/polyfill-php80": "^1.15" - }, - "conflict": { - "symfony/dependency-injection": "<4.4" - }, - "provide": { - "psr/event-dispatcher-implementation": "1.0", - "symfony/event-dispatcher-implementation": "2.0" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "^4.4|^5.0", - "symfony/dependency-injection": "^4.4|^5.0", - "symfony/error-handler": "^4.4|^5.0", - "symfony/expression-language": "^4.4|^5.0", - "symfony/http-foundation": "^4.4|^5.0", - "symfony/service-contracts": "^1.1|^2", - "symfony/stopwatch": "^4.4|^5.0" + "php": ">=7.1" }, "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" + "ext-intl": "For best performance" }, "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\EventDispatcher\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v5.2.2" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-01-27T10:36:42+00:00" - }, - { - "name": "symfony/event-dispatcher-contracts", - "version": "v2.2.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "0ba7d54483095a198fa51781bc608d17e84dffa2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/0ba7d54483095a198fa51781bc608d17e84dffa2", - "reference": "0ba7d54483095a198fa51781bc608d17e84dffa2", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "psr/event-dispatcher": "^1" - }, - "suggest": { - "symfony/event-dispatcher-implementation": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.2-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Contracts\\EventDispatcher\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Generic abstractions related to dispatching event", - "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v2.2.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2020-09-07T11:33:47+00:00" - }, - { - "name": "symfony/finder", - "version": "v5.2.2", - "source": { - "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "196f45723b5e618bf0e23b97e96d11652696ea9e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/196f45723b5e618bf0e23b97e96d11652696ea9e", - "reference": "196f45723b5e618bf0e23b97e96d11652696ea9e", - "shasum": "" - }, - "require": { - "php": ">=7.2.5" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Finder\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Finds files and directories via an intuitive fluent interface", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/finder/tree/v5.2.2" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-01-27T10:01:46+00:00" - }, - { - "name": "symfony/options-resolver", - "version": "v5.2.2", - "source": { - "type": "git", - "url": "https://github.com/symfony/options-resolver.git", - "reference": "5d0f633f9bbfcf7ec642a2b5037268e61b0a62ce" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/5d0f633f9bbfcf7ec642a2b5037268e61b0a62ce", - "reference": "5d0f633f9bbfcf7ec642a2b5037268e61b0a62ce", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1", - "symfony/polyfill-php73": "~1.0", - "symfony/polyfill-php80": "^1.15" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\OptionsResolver\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides an improved replacement for the array_replace PHP function", - "homepage": "https://symfony.com", - "keywords": [ - "config", - "configuration", - "options" - ], - "support": { - "source": "https://github.com/symfony/options-resolver/tree/v5.2.2" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-01-27T12:56:27+00:00" - }, - { - "name": "symfony/polyfill-intl-grapheme", - "version": "v1.22.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "267a9adeb8ecb8071040a740930e077cdfb987af" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/267a9adeb8ecb8071040a740930e077cdfb987af", - "reference": "267a9adeb8ecb8071040a740930e077cdfb987af", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.22-dev" + "extra": { + "branch-alias": { + "dev-main": "1.22-dev" }, "thanks": { "name": "symfony/polyfill", @@ -4971,150 +4315,6 @@ ], "time": "2021-01-07T16:49:33+00:00" }, - { - "name": "symfony/polyfill-php70", - "version": "v1.20.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php70.git", - "reference": "5f03a781d984aae42cebd18e7912fa80f02ee644" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/5f03a781d984aae42cebd18e7912fa80f02ee644", - "reference": "5f03a781d984aae42cebd18e7912fa80f02ee644", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "metapackage", - "extra": { - "branch-alias": { - "dev-main": "1.20-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php70/tree/v1.20.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2020-10-23T14:02:19+00:00" - }, - { - "name": "symfony/polyfill-php72", - "version": "v1.22.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "cc6e6f9b39fe8075b3dabfbaf5b5f645ae1340c9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/cc6e6f9b39fe8075b3dabfbaf5b5f645ae1340c9", - "reference": "cc6e6f9b39fe8075b3dabfbaf5b5f645ae1340c9", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.22-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php72\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php72/tree/v1.22.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-01-07T16:49:33+00:00" - }, { "name": "symfony/polyfill-php73", "version": "v1.22.0", @@ -5609,25 +4809,26 @@ }, { "name": "vimeo/psalm", - "version": "4.4.1", + "version": "4.12.0", "source": { "type": "git", "url": "https://github.com/vimeo/psalm.git", - "reference": "9fd7a7d885b3a216cff8dec9d8c21a132f275224" + "reference": "e42bc4a23f67acba28a23bb09c348e2ff38a1d87" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/9fd7a7d885b3a216cff8dec9d8c21a132f275224", - "reference": "9fd7a7d885b3a216cff8dec9d8c21a132f275224", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/e42bc4a23f67acba28a23bb09c348e2ff38a1d87", + "reference": "e42bc4a23f67acba28a23bb09c348e2ff38a1d87", "shasum": "" }, "require": { - "amphp/amp": "^2.1", + "amphp/amp": "^2.4.2", "amphp/byte-stream": "^1.5", "composer/package-versions-deprecated": "^1.8.0", "composer/semver": "^1.4 || ^2.0 || ^3.0", - "composer/xdebug-handler": "^1.1", + "composer/xdebug-handler": "^1.1 || ^2.0", "dnoegel/php-xdg-base-dir": "^0.1.1", + "ext-ctype": "*", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", @@ -5635,31 +4836,31 @@ "ext-simplexml": "*", "ext-tokenizer": "*", "felixfbecker/advanced-json-rpc": "^3.0.3", - "felixfbecker/language-server-protocol": "^1.4", - "netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0", - "nikic/php-parser": "^4.10.1", + "felixfbecker/language-server-protocol": "^1.5", + "netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0 || ^4.0", + "nikic/php-parser": "^4.13", "openlss/lib-array2xml": "^1.0", "php": "^7.1|^8", "sebastian/diff": "^3.0 || ^4.0", - "symfony/console": "^3.4.17 || ^4.1.6 || ^5.0", + "symfony/console": "^3.4.17 || ^4.1.6 || ^5.0 || ^6.0", "webmozart/path-util": "^2.3" }, "provide": { "psalm/psalm": "self.version" }, "require-dev": { - "amphp/amp": "^2.4.2", "bamarni/composer-bin-plugin": "^1.2", "brianium/paratest": "^4.0||^6.0", "ext-curl": "*", + "php-parallel-lint/php-parallel-lint": "^1.2", "phpdocumentor/reflection-docblock": "^5", "phpmyadmin/sql-parser": "5.1.0||dev-master", "phpspec/prophecy": ">=1.9.0", "phpunit/phpunit": "^9.0", - "psalm/plugin-phpunit": "^0.13", - "slevomat/coding-standard": "^6.3.11", + "psalm/plugin-phpunit": "^0.16", + "slevomat/coding-standard": "^7.0", "squizlabs/php_codesniffer": "^3.5", - "symfony/process": "^4.3", + "symfony/process": "^4.3 || ^5.0 || ^6.0", "weirdan/prophecy-shim": "^1.0 || ^2.0" }, "suggest": { @@ -5707,9 +4908,9 @@ ], "support": { "issues": "https://github.com/vimeo/psalm/issues", - "source": "https://github.com/vimeo/psalm/tree/4.4.1" + "source": "https://github.com/vimeo/psalm/tree/4.12.0" }, - "time": "2021-01-14T21:44:29+00:00" + "time": "2021-11-06T10:31:17+00:00" }, { "name": "webmozart/assert", diff --git a/infection.json.dist b/infection.json.dist index eda367b..c3bfc8d 100644 --- a/infection.json.dist +++ b/infection.json.dist @@ -4,9 +4,6 @@ "src" ] }, - "logs": { - "text": "infection.log" - }, "mutators": { "@default": true } diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 9752841..cbb904e 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -18,5 +18,5 @@ parameters: - message: "#^Parameter \\#1 \\$arrayOfStrings of static method Infection\\\\TestFramework\\\\Codeception\\\\Stringifier\\:\\:stringifyArray\\(\\) expects array\\, array\\ given\\.$#" count: 1 - path: tests/phpunit/StringifierTest.php + path: tests/phpunit/Adapter/StringifierTest.php diff --git a/psalm-baseline.xml b/psalm-baseline.xml index d656360..a95eddc 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1,5 +1,5 @@ - + $includedFiles @@ -40,4 +40,9 @@ FinderException + + + allString + + diff --git a/src/CodeceptionAdapter.php b/src/CodeceptionAdapter.php index 2a59bcc..74c3b0f 100644 --- a/src/CodeceptionAdapter.php +++ b/src/CodeceptionAdapter.php @@ -35,8 +35,13 @@ namespace Infection\TestFramework\Codeception; +use function array_filter; use function array_key_exists; +use function array_map; +use function array_merge; use function assert; +use function explode; +use function implode; use Infection\AbstractTestFramework\Coverage\TestLocation; use Infection\AbstractTestFramework\MemoryUsageAware; use Infection\AbstractTestFramework\TestFrameworkAdapter; @@ -44,11 +49,19 @@ use Infection\TestFramework\Codeception\Coverage\JUnitTestCaseSorter; use InvalidArgumentException; use function is_string; +use const LOCK_EX; use Phar; +use function preg_match; use ReflectionClass; use function Safe\file_put_contents; +use function sprintf; +use function str_replace; +use function strlen; +use function strpos; +use function strstr; use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\Process\Process; +use function trim; final class CodeceptionAdapter implements MemoryUsageAware, TestFrameworkAdapter { diff --git a/src/CodeceptionConfigParseException.php b/src/CodeceptionConfigParseException.php index 1d5ce2b..0564ee9 100644 --- a/src/CodeceptionConfigParseException.php +++ b/src/CodeceptionConfigParseException.php @@ -36,6 +36,7 @@ namespace Infection\TestFramework\Codeception; use Exception; +use function sprintf; final class CodeceptionConfigParseException extends Exception { diff --git a/src/CommandLineBuilder.php b/src/CommandLineBuilder.php index 4586f99..9fdeaf8 100644 --- a/src/CommandLineBuilder.php +++ b/src/CommandLineBuilder.php @@ -35,8 +35,13 @@ namespace Infection\TestFramework\Codeception; +use function array_filter; +use function array_merge; use Infection\Finder\Exception\FinderException; +use function is_executable; use const PHP_SAPI; +use function shell_exec; +use function substr; use Symfony\Component\Process\PhpExecutableFinder; /** diff --git a/src/Stringifier.php b/src/Stringifier.php index 76245bf..48fad21 100644 --- a/src/Stringifier.php +++ b/src/Stringifier.php @@ -35,6 +35,8 @@ namespace Infection\TestFramework\Codeception; +use function implode; +use function sprintf; use Webmozart\Assert\Assert; /** diff --git a/src/VersionParser.php b/src/VersionParser.php index 80a7a9e..9ac977c 100644 --- a/src/VersionParser.php +++ b/src/VersionParser.php @@ -36,6 +36,7 @@ namespace Infection\TestFramework\Codeception; use InvalidArgumentException; +use function preg_match; /** * @internal diff --git a/tests/phpunit/Adapter/CodeceptionAdapterFactoryTest.php b/tests/phpunit/Adapter/CodeceptionAdapterFactoryTest.php new file mode 100644 index 0000000..0121a0d --- /dev/null +++ b/tests/phpunit/Adapter/CodeceptionAdapterFactoryTest.php @@ -0,0 +1,89 @@ +assertInstanceOf(CodeceptionAdapter::class, $adapter); + } + + public function test_it_returns_right_adapter_name(): void + { + $this->assertSame(CodeceptionAdapter::NAME, CodeceptionAdapterFactory::getAdapterName()); + } + + public function test_it_returns_right_executable_name(): void + { + $this->assertSame('codecept', CodeceptionAdapterFactory::getExecutableName()); + } + + public function test_it_throws_an_exception_when_yaml_can_not_be_parsed(): void + { + $this->expectException(CodeceptionConfigParseException::class); + + CodeceptionAdapterFactory::create( + '/path/to/codecept', + '/tmp', + __DIR__ . '/../Fixtures/Files/codeception/invalid_codeception.yml', + null, + '/path/to/junit.xml', + '/path/to/project', + [], + true + ); + } +} diff --git a/tests/phpunit/CodeceptionAdapterTest.php b/tests/phpunit/Adapter/CodeceptionAdapterTest.php similarity index 85% rename from tests/phpunit/CodeceptionAdapterTest.php rename to tests/phpunit/Adapter/CodeceptionAdapterTest.php index 3913f25..ffda8ab 100644 --- a/tests/phpunit/CodeceptionAdapterTest.php +++ b/tests/phpunit/Adapter/CodeceptionAdapterTest.php @@ -33,9 +33,12 @@ declare(strict_types=1); -namespace Infection\Tests\TestFramework\Codeception; +namespace Infection\Tests\TestFramework\Codeception\Adapter; +use function array_merge; +use function file_get_contents; use Generator; +use function implode; use Infection\TestFramework\Codeception\CodeceptionAdapter; use Infection\TestFramework\Codeception\CommandLineBuilder; use Infection\TestFramework\Codeception\Coverage\JUnitTestCaseSorter; @@ -43,6 +46,7 @@ use Infection\Tests\TestFramework\Codeception\FileSystem\FileSystemTestCase; use function Infection\Tests\TestFramework\Codeception\normalizePath as p; use function realpath; +use function sprintf; use Symfony\Component\Filesystem\Filesystem; /** @@ -80,7 +84,7 @@ protected function setUp(): void public function test_it_has_a_name(): void { $adapter = $this->createAdapter(); - self::assertSame('codeception', $adapter->getName()); + $this->assertSame('codeception', $adapter->getName()); } /** @@ -91,7 +95,7 @@ public function test_it_determines_whether_tests_pass_or_not(string $output, boo $adapter = $this->createAdapter(); $result = $adapter->testsPass($output); - self::assertSame($expectedResult, $result); + $this->assertSame($expectedResult, $result); } /** @@ -102,7 +106,7 @@ public function test_it_determines_used_memory_amount(string $output, float $exp $adapter = $this->createAdapter(); $result = $adapter->getMemoryUsed($output); - self::assertSame($expectedResult, $result); + $this->assertSame($expectedResult, $result); } /** @@ -138,8 +142,8 @@ public function test_it_sets_coverage_phpunit_dir(): void $adapter = $this->createAdapter(); $commandLine = $adapter->getInitialTestRunCommandLine('', [], true); - self::assertContains('--coverage-phpunit', $commandLine); - self::assertContains(CodeceptionAdapter::COVERAGE_DIR, $commandLine); + $this->assertContains('--coverage-phpunit', $commandLine); + $this->assertContains(CodeceptionAdapter::COVERAGE_DIR, $commandLine); } public function test_it_sets_junit_xml_path(): void @@ -147,8 +151,8 @@ public function test_it_sets_junit_xml_path(): void $adapter = $this->createAdapter(); $commandLine = $adapter->getInitialTestRunCommandLine('', [], true); - self::assertContains('--xml', $commandLine); - self::assertContains('path/to/junit', $commandLine); + $this->assertContains('--xml', $commandLine); + $this->assertContains('path/to/junit', $commandLine); } public function test_it_sets_the_output_dir_to_tmp_dir(): void @@ -156,7 +160,7 @@ public function test_it_sets_the_output_dir_to_tmp_dir(): void $adapter = $this->createAdapter(); $commandLine = $adapter->getInitialTestRunCommandLine('', [], true); - self::assertContains(sprintf('paths: output: %s', $this->tmp), $commandLine); + $this->assertContains(sprintf('paths: output: %s', $this->tmp), $commandLine); } public function test_it_enables_coverage_if_not_skipped(): void @@ -164,7 +168,7 @@ public function test_it_enables_coverage_if_not_skipped(): void $adapter = $this->createAdapter(); $commandLine = $adapter->getInitialTestRunCommandLine('', [], false); - self::assertContains('coverage: enabled: true', $commandLine); + $this->assertContains('coverage: enabled: true', $commandLine); } public function test_it_disables_coverage_if_skipped(): void @@ -172,8 +176,8 @@ public function test_it_disables_coverage_if_skipped(): void $adapter = $this->createAdapter(); $commandLine = $adapter->getInitialTestRunCommandLine('', [], true); - self::assertContains('coverage: enabled: false', $commandLine); - self::assertContains('coverage: include: []', $commandLine); + $this->assertContains('coverage: enabled: false', $commandLine); + $this->assertContains('coverage: include: []', $commandLine); } public function test_it_populates_include_coverage_key_from_src_folders_if_not_set(): void @@ -181,7 +185,7 @@ public function test_it_populates_include_coverage_key_from_src_folders_if_not_s $adapter = $this->createAdapter(); $commandLine = $adapter->getInitialTestRunCommandLine('', [], false); - self::assertContains('coverage: include: [projectSrc/dir/*.php]', $commandLine); + $this->assertContains('coverage: include: [projectSrc/dir/*.php]', $commandLine); } public function test_it_runs_tests_with_a_random_order(): void @@ -189,7 +193,7 @@ public function test_it_runs_tests_with_a_random_order(): void $adapter = $this->createAdapter(); $commandLine = $adapter->getInitialTestRunCommandLine('', [], false); - self::assertContains('settings: shuffle: true', $commandLine); + $this->assertContains('settings: shuffle: true', $commandLine); } public function test_it_disables_coverage_for_mutant_command_line(): void @@ -203,7 +207,7 @@ public function test_it_disables_coverage_for_mutant_command_line(): void '' ); - self::assertContains('coverage: enabled: false', $commandLine); + $this->assertContains('coverage: enabled: false', $commandLine); } public function test_it_adds_extra_options_for_mutant_command_line(): void @@ -217,7 +221,7 @@ public function test_it_adds_extra_options_for_mutant_command_line(): void '--filter=xyz' ); - self::assertContains('--filter=xyz', $commandLine); + $this->assertContains('--filter=xyz', $commandLine); } public function test_it_sets_infection_group(): void @@ -231,8 +235,8 @@ public function test_it_sets_infection_group(): void '--filter=xyz' ); - self::assertContains('--group', $commandLine); - self::assertContains('infection', $commandLine); + $this->assertContains('--group', $commandLine); + $this->assertContains('infection', $commandLine); } public function test_it_sets_bootstrap_file(): void @@ -246,7 +250,7 @@ public function test_it_sets_bootstrap_file(): void '--filter=xyz' ); - self::assertContains('--bootstrap', $commandLine); + $this->assertContains('--bootstrap', $commandLine); } public function test_it_creates_interceptor_file(): void @@ -263,7 +267,7 @@ public function test_it_creates_interceptor_file(): void $expectedConfigPath = $this->tmp . '/interceptor.codeception.a1b2c3.php'; - self::assertFileExists($expectedConfigPath); + $this->assertFileExists($expectedConfigPath); } public function test_it_does_not_add_original_bootstrap_to_the_created_config_file_if_not_exists(): void @@ -278,7 +282,7 @@ public function test_it_does_not_add_original_bootstrap_to_the_created_config_fi '' ); - self::assertStringNotContainsString( + $this->assertStringNotContainsString( 'bootstrap', (string) file_get_contents($this->tmp . '/interceptor.codeception.a1b2c3.php') ); @@ -303,7 +307,7 @@ public function test_adds_original_bootstrap_to_the_created_config_file_with_abs '' ); - self::assertStringContainsString( + $this->assertStringContainsString( "require_once '/original/bootstrap.php';", (string) file_get_contents($this->tmp . '/interceptor.codeception.a1b2c3.php') ); @@ -328,7 +332,7 @@ public function test_adds_original_bootstrap_to_the_created_config_file_with_rel '' ); - self::assertStringContainsString( + $this->assertStringContainsString( "tests/original/bootstrap.php';", (string) file_get_contents($this->tmp . '/interceptor.codeception.a1b2c3.php') ); @@ -338,12 +342,12 @@ public function test_it_has_junit_report(): void { $adapter = $this->createAdapter(); - self::assertTrue($adapter->hasJUnitReport(), 'Codeception Framework must have JUnit report'); + $this->assertTrue($adapter->hasJUnitReport(), 'Codeception Framework must have JUnit report'); } public function test_codeception_name(): void { - self::assertSame('codeception', $this->createAdapter()->getName()); + $this->assertSame('codeception', $this->createAdapter()->getName()); } public function test_prepare_arguments_and_options_contains_run_first(): void @@ -358,7 +362,7 @@ public function test_prepare_arguments_and_options_contains_run_first(): void '--skip blah' ); - self::assertStringContainsString( + $this->assertStringContainsString( 'path/to/codeception run --skip blah', implode(' ', $commandLine) ); diff --git a/tests/phpunit/CodeceptionAdapterFactoryTest.php b/tests/phpunit/Adapter/CodeceptionConfigParseExceptionTest.php similarity index 70% rename from tests/phpunit/CodeceptionAdapterFactoryTest.php rename to tests/phpunit/Adapter/CodeceptionConfigParseExceptionTest.php index 27bac31..9197954 100644 --- a/tests/phpunit/CodeceptionAdapterFactoryTest.php +++ b/tests/phpunit/Adapter/CodeceptionConfigParseExceptionTest.php @@ -33,30 +33,28 @@ declare(strict_types=1); -namespace Infection\Tests\TestFramework\Codeception; +namespace Infection\Tests\TestFramework\Codeception\Adapter; -use Infection\TestFramework\Codeception\CodeceptionAdapter; -use Infection\TestFramework\Codeception\CodeceptionAdapterFactory; +use Infection\TestFramework\Codeception\CodeceptionConfigParseException; use PHPUnit\Framework\TestCase; +use function sprintf; +use Symfony\Component\Yaml\Exception\ParseException; -/** - * @group integration Requires some I/O operations - */ -final class CodeceptionAdapterFactoryTest extends TestCase +final class CodeceptionConfigParseExceptionTest extends TestCase { - public function test_it_creates_codeception_adapter(): void + public function test_from_path_message(): void { - $adapter = CodeceptionAdapterFactory::create( - '/path/to/codecept', - '/tmp', - __DIR__ . '/Fixtures/Files/codeception/codeception.yml', - null, - '/path/to/junit.xml', - '/path/to/project', - [], - true - ); + $originalException = new ParseException('Yaml invalid'); - self::assertInstanceOf(CodeceptionAdapter::class, $adapter); + $exception = CodeceptionConfigParseException::fromPath('/path', $originalException); + + $this->assertSame( + sprintf( + "Error loading Yaml config from '%s'\n \n%s", + '/path', + $originalException->getMessage() + ), + $exception->getMessage() + ); } } diff --git a/tests/phpunit/Adapter/Coverage/JUnitTestCaseSorterTest.php b/tests/phpunit/Adapter/Coverage/JUnitTestCaseSorterTest.php new file mode 100644 index 0000000..77c2d5d --- /dev/null +++ b/tests/phpunit/Adapter/Coverage/JUnitTestCaseSorterTest.php @@ -0,0 +1,62 @@ +assertSame( + [ + '/path/build.php', + '/path/test.php', + ], + $sorter->getUniqueSortedFileNames($tests) + ); + } +} diff --git a/tests/phpunit/StringifierTest.php b/tests/phpunit/Adapter/StringifierTest.php similarity index 92% rename from tests/phpunit/StringifierTest.php rename to tests/phpunit/Adapter/StringifierTest.php index c230b45..86558a0 100644 --- a/tests/phpunit/StringifierTest.php +++ b/tests/phpunit/Adapter/StringifierTest.php @@ -33,7 +33,7 @@ declare(strict_types=1); -namespace Infection\Tests\TestFramework\Codeception; +namespace Infection\Tests\TestFramework\Codeception\Adapter; use Generator; use Infection\TestFramework\Codeception\Stringifier; @@ -47,7 +47,7 @@ final class StringifierTest extends TestCase */ public function test_stringify_boolean(bool $boolean, string $expectedStringBoolean): void { - self::assertSame($expectedStringBoolean, Stringifier::stringifyBoolean($boolean)); + $this->assertSame($expectedStringBoolean, Stringifier::stringifyBoolean($boolean)); } /** @@ -57,7 +57,7 @@ public function test_stringify_boolean(bool $boolean, string $expectedStringBool */ public function test_stringify_array_of_strings(array $arrayOfStrings, string $expectedStringArray): void { - self::assertSame($expectedStringArray, Stringifier::stringifyArray($arrayOfStrings)); + $this->assertSame($expectedStringArray, Stringifier::stringifyArray($arrayOfStrings)); } public function test_stringify_array_of_strings_works_only_with_array_of_strings(): void diff --git a/tests/phpunit/Adapter/VersionParserTest.php b/tests/phpunit/Adapter/VersionParserTest.php new file mode 100644 index 0000000..2f0953b --- /dev/null +++ b/tests/phpunit/Adapter/VersionParserTest.php @@ -0,0 +1,110 @@ +versionParser = new VersionParser(); + } + + /** + * @dataProvider versionProvider + */ + public function test_it_parses_version_from_string(string $content, string $expectedVersion): void + { + $result = $this->versionParser->parse($content); + + $this->assertSame($expectedVersion, $result); + } + + public function test_it_throws_exception_when_content_has_no_version_substring(): void + { + try { + $this->versionParser->parse('abc'); + + $this->fail(); + } catch (InvalidArgumentException $exception) { + $this->assertSame( + 'Parameter does not contain a valid SemVer (sub)string.', + $exception->getMessage() + ); + } + } + + /** + * @return iterable> + */ + public function versionProvider(): iterable + { + yield 'nominal stable' => ['7.0.2', '7.0.2']; + + yield 'nominal development' => ['0.2.8', '0.2.8']; + + yield 'stable variant' => ['v7.0.2', '7.0.2']; + + yield 'development variant' => ['v0.2.8', '0.2.8']; + + yield 'patch' => ['7.0.2-patch', '7.0.2-patch']; + + yield 'versioned patch' => ['7.0.2-patch.0', '7.0.2-patch.0']; + + yield 'RC' => ['7.0.2-rc', '7.0.2-rc']; + + yield 'uppercase RC' => ['7.0.2-RC', '7.0.2-RC']; + + yield 'versioned RC' => ['7.0.2-rc.0', '7.0.2-rc.0']; + + yield 'with spaces' => [' 7.0.2 ', '7.0.2']; + + yield 'nonsense suffix 0' => ['7.0.2foo', '7.0.2']; + + yield 'nonsense suffix 1' => ['7.0.2-foo', '7.0.2-foo']; + + yield 'Hoa' => ['3.17.05.02', '3.17.05']; + + yield 'phpspec stable' => ['phpspec 7.1.0', '7.1.0']; + + yield 'phpspec RC' => ['phpspec version 5.0.0-rc1', '5.0.0-rc1']; + } +} diff --git a/tests/phpunit/Fixtures/Files/codeception/invalid_codeception.yml b/tests/phpunit/Fixtures/Files/codeception/invalid_codeception.yml new file mode 100644 index 0000000..666787e --- /dev/null +++ b/tests/phpunit/Fixtures/Files/codeception/invalid_codeception.yml @@ -0,0 +1,10 @@ +paths: + - tests: tests + output: tests/_output + data: tests/_data + support: tests/_support + envs: tests/_envs +actor_suffix: Tester +extensions: + enabled: + - Codeception\Extension\RunFailed