From cc33ff2c123fe59ab7edf7d7b40c9d56c03204af Mon Sep 17 00:00:00 2001 From: Jakub Zalas Date: Fri, 4 Feb 2022 21:02:42 +0000 Subject: [PATCH 1/4] Update box --- Makefile | 2 +- scoper.inc.php | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 75f57f3b..24f12b24 100644 --- a/Makefile +++ b/Makefile @@ -141,4 +141,4 @@ tools/deptrac: curl -Ls https://github.com/qossmic/deptrac/releases/download/0.18.0/deptrac.phar.asc -o tools/deptrac.asc tools/box: - curl -Ls https://github.com/humbug/box/releases/download/3.14.0/box.phar -o tools/box && chmod +x tools/box + curl -Ls https://github.com/humbug/box/releases/download/3.15.0/box.phar -o tools/box && chmod +x tools/box diff --git a/scoper.inc.php b/scoper.inc.php index 53891075..4b38b328 100644 --- a/scoper.inc.php +++ b/scoper.inc.php @@ -2,14 +2,14 @@ return [ // Whitelist globals so that Symfony polyfills are not scoped - 'whitelist-global-constants' => true, - 'whitelist-global-classes' => true, - 'whitelist-global-functions' => true, - 'files-whitelist' => [ + 'expose-global-constants' => true, + 'expose-global-classes' => true, + 'expose-global-functions' => true, + 'exclude-files' => [ 'vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php', 'vendor/symfony/polyfill-php80/bootstrap.php', ], - 'whitelist' => [ + 'exclude-namespaces' => [ 'Symfony\\Polyfill\\Php80\\*' ] ]; From 9f1695beb10358cf82109a82cd2330446ec395c4 Mon Sep 17 00:00:00 2001 From: Jakub Zalas Date: Fri, 4 Feb 2022 21:12:18 +0000 Subject: [PATCH 2/4] Drop php-formatter Project is no longer actively maintained and there has been no release since 2017. Since it uses a legacy box version it can no longer be build on PHP 8.1 --- resources/checkstyle.json | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/resources/checkstyle.json b/resources/checkstyle.json index 1da7dcd3..06aecea3 100644 --- a/resources/checkstyle.json +++ b/resources/checkstyle.json @@ -28,21 +28,6 @@ "test": "php-cs-fixer list", "tags": ["featured", "checkstyle"] }, - { - "name": "php-formatter", - "summary": "Custom coding standards fixer", - "website": "https://github.com/mmoreram/php-formatter", - "command": { - "box-build": { - "repository": "https://github.com/mmoreram/php-formatter.git", - "phar": "build/php-formatter.phar", - "bin": "%target-dir%/php-formatter", - "version": "1fa3d9a3e1c67654f3fe2511bd28fa7c33b59d7e" - } - }, - "test": "php-formatter list", - "tags": ["checkstyle", "exclude-php:8.1", "exclude-php:8.0"] - }, { "name": "phpcbf", "summary": "Automatically corrects coding standard violations", From 30bc0882c7caa9ba877f04155b7d833edd3cab4c Mon Sep 17 00:00:00 2001 From: Jakub Zalas Date: Fri, 4 Feb 2022 21:17:08 +0000 Subject: [PATCH 3/4] Remove box v2 --- README.md | 4 ++-- resources/pre-installation.json | 14 -------------- src/Tool/Command/BoxBuildCommand.php | 2 +- tests/Tool/Command/BoxBuildCommandTest.php | 2 +- tests/UseCase/InstallToolsTest.php | 2 +- 5 files changed, 5 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 1cbd31a9..e295263a 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,6 @@ It has been extracted as a separate project to make maintenance easier and enabl | analyze | [Visualizes metrics and source code](https://github.com/Qafoo/QualityAnalyzer) | ✅ | ❌ | ❌ | | behat | [Helps to test business expectations](http://behat.org/) | ✅ | ✅ | ✅ | | box | [Fast, zero config application bundler with PHARs](https://github.com/humbug/box) | ✅ | ✅ | ✅ | -| box-legacy | [Legacy version of box](https://box-project.github.io/box2/) | ✅ | ✅ | ✅ | | churn | [Discovers good candidates for refactoring](https://github.com/bmitch/churn-php) | ✅ | ✅ | ✅ | | codeception | [Codeception is a BDD-styled PHP testing framework](https://codeception.com/) | ✅ | ✅ | ✅ | | composer | [Dependency Manager for PHP](https://getcomposer.org/) | ✅ | ✅ | ✅ | @@ -43,7 +42,6 @@ It has been extracted as a separate project to make maintenance easier and enabl | phive | [PHAR Installation and Verification Environment](https://phar.io/) | ✅ | ✅ | ✅ | | php-coupling-detector | [Detects code coupling issues](https://akeneo.github.io/php-coupling-detector/) | ✅ | ✅ | ✅ | | php-cs-fixer | [PHP Coding Standards Fixer](http://cs.symfony.com/) | ✅ | ✅ | ✅ | -| php-formatter | [Custom coding standards fixer](https://github.com/mmoreram/php-formatter) | ✅ | ❌ | ❌ | | php-fuzzer | [A fuzzer for PHP, which can be used to find bugs in libraries by feeding them 'random' inputs](https://github.com/nikic/PHP-Fuzzer) | ✅ | ✅ | ✅ | | php-semver-checker | [Suggests a next version according to semantic versioning](https://github.com/tomzx/php-semver-checker) | ✅ | ✅ | ✅ | | phpa | [Checks for weak assumptions](https://github.com/rskuipers/php-assumptions) | ✅ | ✅ | ✅ | @@ -100,9 +98,11 @@ It has been extracted as a separate project to make maintenance easier and enabl | Name | Summary | | :--- | :------ | +| box-legacy | [Legacy version of box](https://box-project.github.io/box2/) | | composer-normalize | [Composer plugin to normalize composer.json files](https://github.com/localheinz/composer-normalize) | | design-pattern | [Detects design patterns](https://github.com/Halleck45/DesignPatternDetector) | | parallel-lint | [Checks PHP file syntax](https://github.com/JakubOnderka/PHP-Parallel-Lint) | +| php-formatter | [Custom coding standards fixer](https://github.com/mmoreram/php-formatter) | | phpcf | [Finds usage of deprecated features](http://wapmorgan.github.io/PhpCodeFixer/) | | phpstan-localheinz-rules | [Additional rules for PHPstan](https://github.com/localheinz/phpstan-rules) | | security-checker | [Checks composer dependencies for known security vulnerabilities](https://github.com/sensiolabs/security-checker) | diff --git a/resources/pre-installation.json b/resources/pre-installation.json index 54172650..a1d79b90 100644 --- a/resources/pre-installation.json +++ b/resources/pre-installation.json @@ -59,20 +59,6 @@ }, "test": "box list", "tags": ["pre-installation"] - }, - { - "name": "box-legacy", - "summary": "Legacy version of box", - "website": "https://box-project.github.io/box2/", - "command": { - "phive-install": { - "alias": "box-project/box2", - "bin": "%target-dir%/box-legacy", - "sig": "293D771241515FE8" - } - }, - "test": "box-legacy list", - "tags": ["pre-installation"] } ] } diff --git a/src/Tool/Command/BoxBuildCommand.php b/src/Tool/Command/BoxBuildCommand.php index 972825ab..c6c43e2e 100644 --- a/src/Tool/Command/BoxBuildCommand.php +++ b/src/Tool/Command/BoxBuildCommand.php @@ -24,7 +24,7 @@ public function __construct(string $repository, string $phar, string $bin, strin public function __toString(): string { return \sprintf( - 'git clone %s %s&& cd %s && git checkout %s && composer install --no-dev --no-suggest --prefer-dist -n && box-legacy build && mv %s %s && chmod +x %s && cd && rm -rf %s', + 'git clone %s %s&& cd %s && git checkout %s && composer install --no-dev --no-suggest --prefer-dist -n && box compile && mv %s %s && chmod +x %s && cd && rm -rf %s', $this->repository, $this->targetDir(), $this->targetDir(), diff --git a/tests/Tool/Command/BoxBuildCommandTest.php b/tests/Tool/Command/BoxBuildCommandTest.php index 8d99fd85..8461e452 100644 --- a/tests/Tool/Command/BoxBuildCommandTest.php +++ b/tests/Tool/Command/BoxBuildCommandTest.php @@ -45,7 +45,7 @@ public function test_it_generates_the_installation_command() $this->assertMatchesRegularExpression('#cd /tools/behat#', (string) $command); $this->assertMatchesRegularExpression('#git checkout '.self::VERSION.'#', (string) $command); $this->assertMatchesRegularExpression('#composer install --no-dev --no-suggest --prefer-dist -n#', (string) $command); - $this->assertMatchesRegularExpression('#box-legacy build#', (string) $command); + $this->assertMatchesRegularExpression('#box compile#', (string) $command); } public function test_it_tries_to_guess_version_number_if_not_given_one() diff --git a/tests/UseCase/InstallToolsTest.php b/tests/UseCase/InstallToolsTest.php index 76efa84a..3909e191 100644 --- a/tests/UseCase/InstallToolsTest.php +++ b/tests/UseCase/InstallToolsTest.php @@ -146,7 +146,7 @@ public function test_it_includes_box_build_commands() $command = $this->useCase->__invoke($this->filter()); - $this->assertMatchesRegularExpression('#box-legacy build#', (string)$command); + $this->assertMatchesRegularExpression('#box compile#', (string)$command); } public function test_it_includes_phar_download_commands() From e1d1fe7409c3d89eb0fb9026b351282f377d90cd Mon Sep 17 00:00:00 2001 From: Jakub Zalas Date: Fri, 4 Feb 2022 21:20:15 +0000 Subject: [PATCH 4/4] Fix scoper configuration --- scoper.inc.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scoper.inc.php b/scoper.inc.php index 4b38b328..91c5e86d 100644 --- a/scoper.inc.php +++ b/scoper.inc.php @@ -8,8 +8,11 @@ 'exclude-files' => [ 'vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php', 'vendor/symfony/polyfill-php80/bootstrap.php', + 'vendor/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php', + 'vendor/symfony/polyfill-intl-normalizer/bootstrap.php', + ], + 'expose-namespaces' => [ + 'Symfony\Polyfill\Php80', + 'Symfony\Polyfill\Intl', ], - 'exclude-namespaces' => [ - 'Symfony\\Polyfill\\Php80\\*' - ] ];