From e6c63fa612790ee76a8258da7e4a042a6907bd70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20FIDRY?= <5175937+theofidry@users.noreply.github.com> Date: Sat, 14 Oct 2023 00:42:05 +0200 Subject: [PATCH 1/7] chore: Bump the min version of thecodingmachine/safe (#849) --- composer.json | 2 +- composer.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index f2283add..28ac692f 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,7 @@ "symfony/console": "^5.2 || ^6.0", "symfony/filesystem": "^5.2 || ^6.0", "symfony/finder": "^5.2 || ^6.0", - "thecodingmachine/safe": "^1.3 || ^2.0" + "thecodingmachine/safe": "^2.0" }, "require-dev": { "bamarni/composer-bin-plugin": "^1.1", diff --git a/composer.lock b/composer.lock index c064b6e1..79225acf 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": "dcd68062c3ca5bcf7fa8494490081303", + "content-hash": "2244bb644c3c3ab01f4a74616dd5a288", "packages": [ { "name": "fidry/console", @@ -5488,5 +5488,5 @@ "platform-overrides": { "php": "8.1.0" }, - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.6.0" } From cbf24d2608bb2248dea19984eb36382fbf0f9c2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20FIDRY?= <5175937+theofidry@users.noreply.github.com> Date: Sat, 14 Oct 2023 00:49:15 +0200 Subject: [PATCH 2/7] style: Upgrade PHP-CS-Fixer (#850) - Update `friendsofphp/php-cs-fixer` from `3.13.0` to `3.35.1`. - Migrate from `theofidry/php-cs-fixer-config` to `fidry/php-cs-fixer-config`. --- .../src/CouldNotParseTag.php | 2 +- composer-root-version-checker/src/Logger.php | 2 +- src/Autoload/ScoperAutoloadGenerator.php | 2 +- src/Configuration/Configuration.php | 16 +- src/Scoper/Composer/AutoloadPrefixer.php | 8 +- .../AddPrefixCommandIntegrationTest.php | 1 + tests/FunctionsTest.php | 8 +- tests/Scoper/PhpScoperSpecTest.php | 4 +- tests/Symbol/SymbolsRegistryTest.php | 4 +- vendor-bin/php-cs-fixer/composer.json | 2 +- vendor-bin/php-cs-fixer/composer.lock | 589 ++++++------------ 11 files changed, 218 insertions(+), 420 deletions(-) diff --git a/composer-root-version-checker/src/CouldNotParseTag.php b/composer-root-version-checker/src/CouldNotParseTag.php index 14359bc5..dba81f7f 100644 --- a/composer-root-version-checker/src/CouldNotParseTag.php +++ b/composer-root-version-checker/src/CouldNotParseTag.php @@ -44,7 +44,7 @@ public static function noNameTagFound( } public static function withReason( - null|bool|int|float|string $tag, + null|bool|float|int|string $tag, string $reason ): self { return new self( diff --git a/composer-root-version-checker/src/Logger.php b/composer-root-version-checker/src/Logger.php index 6ffbadae..ac5b6645 100644 --- a/composer-root-version-checker/src/Logger.php +++ b/composer-root-version-checker/src/Logger.php @@ -31,7 +31,7 @@ public function __destruct() $this->writeRecords(); } - public function log($level, Stringable|string $message, array $context = []): void + public function log($level, string|Stringable $message, array $context = []): void { $record = sprintf('[%s] %s', $level, $message).PHP_EOL; diff --git a/src/Autoload/ScoperAutoloadGenerator.php b/src/Autoload/ScoperAutoloadGenerator.php index f2b01aa7..6b4c1e79 100644 --- a/src/Autoload/ScoperAutoloadGenerator.php +++ b/src/Autoload/ScoperAutoloadGenerator.php @@ -217,7 +217,7 @@ private static function createClassAliasStatement( * * @return list */ - private static function wrapStatementsInNamespaceBlock(string $namespace, string|array $statements): array + private static function wrapStatementsInNamespaceBlock(string $namespace, array|string $statements): array { if (is_string($statements)) { $statements = explode(self::$eol, $statements); diff --git a/src/Configuration/Configuration.php b/src/Configuration/Configuration.php index cbd1cb50..4ad285aa 100644 --- a/src/Configuration/Configuration.php +++ b/src/Configuration/Configuration.php @@ -29,15 +29,15 @@ final class Configuration private readonly string $prefix; /** - * @param non-empty-string|null $path Absolute canonical path to the configuration file loaded. - * @param non-empty-string|null $outputDir Absolute canonical path to the output directory. - * @param non-empty-string $prefix The prefix applied. - * @param array $filesWithContents Array of tuple with the - * first argument being the file path and the second - * its contents + * @param non-empty-string|null $path Absolute canonical path to the configuration file loaded. + * @param non-empty-string|null $outputDir Absolute canonical path to the output directory. + * @param non-empty-string $prefix The prefix applied. + * @param array $filesWithContents Array of tuple with the + * first argument being the file path and the second + * its contents * @param array $excludedFilesWithContents Array of tuple - * with the first argument being the file path and - * the second its contents + * with the first argument being the file path and + * the second its contents */ public function __construct( private ?string $path, diff --git a/src/Scoper/Composer/AutoloadPrefixer.php b/src/Scoper/Composer/AutoloadPrefixer.php index 5c9fa0a9..74afc85b 100644 --- a/src/Scoper/Composer/AutoloadPrefixer.php +++ b/src/Scoper/Composer/AutoloadPrefixer.php @@ -133,7 +133,7 @@ private static function prefixAutoload( /** * @param array $psr0 * @param (string|string[])[] $psr4 - * @param string[] $classMap + * @param string[] $classMap */ private static function transformPsr0ToPsr4AndClassmap(array $psr0, array $psr4, array $classMap): array { @@ -168,7 +168,7 @@ private static function transformPsr0ToPsr4AndClassmap(array $psr0, array $psr4, * * @return string|string[] */ - private static function updatePSR0Path(string|array $path, string $namespace): string|array + private static function updatePSR0Path(array|string $path, string $namespace): array|string { $namespaceForPsr = rtrim( str_replace('\\', '/', $namespace), @@ -204,12 +204,12 @@ private static function updatePSR0Path(string|array $path, string $namespace): s * string | * or simply the namespace not existing as a psr-4 entry. * - * @param string|string[] $psr0Path + * @param string|string[] $psr0Path * @param (string|string[])[] $psr4 * * @return string|string[] */ - private static function mergeNamespaces(string $psr0Namespace, string|array $psr0Path, array $psr4): string|array + private static function mergeNamespaces(string $psr0Namespace, array|string $psr0Path, array $psr4): array|string { // Both strings if (is_string($psr0Path) && is_string($psr4[$psr0Namespace])) { diff --git a/tests/Console/Command/AddPrefixCommandIntegrationTest.php b/tests/Console/Command/AddPrefixCommandIntegrationTest.php index 92bcd3da..356ad422 100644 --- a/tests/Console/Command/AddPrefixCommandIntegrationTest.php +++ b/tests/Console/Command/AddPrefixCommandIntegrationTest.php @@ -286,6 +286,7 @@ public function test_scope_in_very_verbose_mode(): void $extraDisplayNormalization = static function (string $display): string { $display = preg_replace('/(Could not parse the file ".+?"\.: \w+).*(\n)/', '$1$2', $display); $display = preg_replace('/(#\d+).*(\n)/', '$1$2', $display); + // Remove overly lengthy stack-trace return preg_replace('/(Stack trace:(?:\n\#\d)+)\n?((?:\n\#\d{2,})+)/', '$1', $display); }; diff --git a/tests/FunctionsTest.php b/tests/FunctionsTest.php index 3d1d14d5..8f717179 100644 --- a/tests/FunctionsTest.php +++ b/tests/FunctionsTest.php @@ -88,10 +88,14 @@ public static function provideGenerators(): iterable yield [ [ (static function (): Generator { - yield from ['a' => 'alpha', 'b' => 'beta', 2 => 'two']; + yield 'a' => 'alpha'; + yield 'b' => 'beta'; + yield 2 => 'two'; })(), (static function (): Generator { - yield from [0, 1, 2]; + yield 0; + yield 1; + yield 2; })(), ], [ diff --git a/tests/Scoper/PhpScoperSpecTest.php b/tests/Scoper/PhpScoperSpecTest.php index ff5af1b8..164a90cc 100644 --- a/tests/Scoper/PhpScoperSpecTest.php +++ b/tests/Scoper/PhpScoperSpecTest.php @@ -300,7 +300,7 @@ private static function createScoper( ); } - private static function parseSpecFile(string $file, array $meta, string|int $fixtureTitle, string|array $fixtureSet): iterable + private static function parseSpecFile(string $file, array $meta, int|string $fixtureTitle, array|string $fixtureSet): iterable { static $specMetaKeys; static $specKeys; @@ -377,7 +377,7 @@ private static function parseSpecFile(string $file, array $meta, string|int $fix private static function createSymbolsConfiguration( string $file, - string|array $fixtureSet, + array|string $fixtureSet, array $meta ): SymbolsConfiguration { if (is_string($fixtureSet)) { diff --git a/tests/Symbol/SymbolsRegistryTest.php b/tests/Symbol/SymbolsRegistryTest.php index 7009dcb1..f9bb04b8 100644 --- a/tests/Symbol/SymbolsRegistryTest.php +++ b/tests/Symbol/SymbolsRegistryTest.php @@ -30,8 +30,8 @@ final class SymbolsRegistryTest extends TestCase * * @param array $functions * @param array $classes - * @param list $expectedRecordedFunctions - * @param list $expectedRecordedClasses + * @param list $expectedRecordedFunctions + * @param list $expectedRecordedClasses */ public function test_it_records_functions_and_classes( array $functions, diff --git a/vendor-bin/php-cs-fixer/composer.json b/vendor-bin/php-cs-fixer/composer.json index a88a56c8..5fe23739 100644 --- a/vendor-bin/php-cs-fixer/composer.json +++ b/vendor-bin/php-cs-fixer/composer.json @@ -1,6 +1,6 @@ { "require-dev": { "friendsofphp/php-cs-fixer": "^3.12", - "theofidry/php-cs-fixer-config": "^1.0" + "fidry/php-cs-fixer-config": "^1.0" } } diff --git a/vendor-bin/php-cs-fixer/composer.lock b/vendor-bin/php-cs-fixer/composer.lock index accbd352..46a6b946 100644 --- a/vendor-bin/php-cs-fixer/composer.lock +++ b/vendor-bin/php-cs-fixer/composer.lock @@ -4,21 +4,21 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "38beeb771ff7647b6b3202b50bdefebf", + "content-hash": "f2c6f30e9e818a2b9269bc287dbd5183", "packages": [], "packages-dev": [ { "name": "composer/pcre", - "version": "3.0.2", + "version": "3.1.1", "source": { "type": "git", "url": "https://github.com/composer/pcre.git", - "reference": "4482b6409ca6bfc2af043a5711cd21ac3e7a8dfb" + "reference": "00104306927c7a0919b4ced2aaa6782c1e61a3c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/4482b6409ca6bfc2af043a5711cd21ac3e7a8dfb", - "reference": "4482b6409ca6bfc2af043a5711cd21ac3e7a8dfb", + "url": "https://api.github.com/repos/composer/pcre/zipball/00104306927c7a0919b4ced2aaa6782c1e61a3c9", + "reference": "00104306927c7a0919b4ced2aaa6782c1e61a3c9", "shasum": "" }, "require": { @@ -60,7 +60,7 @@ ], "support": { "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/3.0.2" + "source": "https://github.com/composer/pcre/tree/3.1.1" }, "funding": [ { @@ -76,20 +76,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T20:24:16+00:00" + "time": "2023-10-11T07:11:09+00:00" }, { "name": "composer/semver", - "version": "3.3.2", + "version": "3.4.0", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9" + "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/3953f23262f2bff1919fc82183ad9acb13ff62c9", - "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9", + "url": "https://api.github.com/repos/composer/semver/zipball/35e8d0af4486141bc745f23a29cc2091eb624a32", + "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32", "shasum": "" }, "require": { @@ -139,9 +139,9 @@ "versioning" ], "support": { - "irc": "irc://irc.freenode.org/composer", + "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.3.2" + "source": "https://github.com/composer/semver/tree/3.4.0" }, "funding": [ { @@ -157,7 +157,7 @@ "type": "tidelift" } ], - "time": "2022-04-01T19:23:25+00:00" + "time": "2023-08-31T09:50:34+00:00" }, { "name": "composer/xdebug-handler", @@ -226,105 +226,36 @@ "time": "2022-02-25T21:32:43+00:00" }, { - "name": "doctrine/annotations", - "version": "1.13.3", + "name": "fidry/php-cs-fixer-config", + "version": "1.1.3", "source": { "type": "git", - "url": "https://github.com/doctrine/annotations.git", - "reference": "648b0343343565c4a056bfc8392201385e8d89f0" + "url": "https://github.com/theofidry/php-cs-fixer-config.git", + "reference": "1a8730ed7e28f7eab456843544a8e1a337253175" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/648b0343343565c4a056bfc8392201385e8d89f0", - "reference": "648b0343343565c4a056bfc8392201385e8d89f0", + "url": "https://api.github.com/repos/theofidry/php-cs-fixer-config/zipball/1a8730ed7e28f7eab456843544a8e1a337253175", + "reference": "1a8730ed7e28f7eab456843544a8e1a337253175", "shasum": "" }, "require": { - "doctrine/lexer": "1.*", - "ext-tokenizer": "*", - "php": "^7.1 || ^8.0", - "psr/cache": "^1 || ^2 || ^3" - }, - "require-dev": { - "doctrine/cache": "^1.11 || ^2.0", - "doctrine/coding-standard": "^6.0 || ^8.1", - "phpstan/phpstan": "^1.4.10 || ^1.8.0", - "phpunit/phpunit": "^7.5 || ^8.0 || ^9.1.5", - "symfony/cache": "^4.4 || ^5.2", - "vimeo/psalm": "^4.10" - }, - "type": "library", - "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.13.3" - }, - "time": "2022-07-02T10:48:51+00:00" - }, - { - "name": "doctrine/lexer", - "version": "1.2.3", - "source": { - "type": "git", - "url": "https://github.com/doctrine/lexer.git", - "reference": "c268e882d4dbdd85e36e4ad69e02dc284f89d229" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/c268e882d4dbdd85e36e4ad69e02dc284f89d229", - "reference": "c268e882d4dbdd85e36e4ad69e02dc284f89d229", - "shasum": "" + "php": "^7.2 || ^8.0" }, - "require": { - "php": "^7.1 || ^8.0" + "conflict": { + "friendsofphp/php-cs-fixer": "<3.19.0,>=4.0" }, "require-dev": { - "doctrine/coding-standard": "^9.0", - "phpstan/phpstan": "^1.3", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "vimeo/psalm": "^4.11" + "ergebnis/composer-normalize": "~2.13.0", + "fidry/makefile": "^0.2.1", + "friendsofphp/php-cs-fixer": "^3.19.0", + "phpunit/phpunit": "^9.4.3", + "symfony/filesystem": "^5.4 || ^6.1" }, "type": "library", "autoload": { "psr-4": { - "Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer" + "Fidry\\PhpCsFixerConfig\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -333,94 +264,62 @@ ], "authors": [ { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" + "name": "Théo FIDRY", + "email": "theo.fidry@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" - ], + "description": "The PHP-CS-Fixer default config for my projects", "support": { - "issues": "https://github.com/doctrine/lexer/issues", - "source": "https://github.com/doctrine/lexer/tree/1.2.3" + "issues": "https://github.com/theofidry/php-cs-fixer-config/issues", + "source": "https://github.com/theofidry/php-cs-fixer-config/tree/1.1.3" }, - "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": "2022-02-28T11:07:21+00:00" + "time": "2023-09-17T21:19:26+00:00" }, { "name": "friendsofphp/php-cs-fixer", - "version": "v3.13.0", + "version": "v3.35.1", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", - "reference": "a6232229a8309e8811dc751c28b91cb34b2943e1" + "reference": "ec1ccc264994b6764882669973ca435cf05bab08" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/a6232229a8309e8811dc751c28b91cb34b2943e1", - "reference": "a6232229a8309e8811dc751c28b91cb34b2943e1", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/ec1ccc264994b6764882669973ca435cf05bab08", + "reference": "ec1ccc264994b6764882669973ca435cf05bab08", "shasum": "" }, "require": { - "composer/semver": "^3.2", + "composer/semver": "^3.3", "composer/xdebug-handler": "^3.0.3", - "doctrine/annotations": "^1.13", "ext-json": "*", "ext-tokenizer": "*", "php": "^7.4 || ^8.0", - "sebastian/diff": "^4.0", + "sebastian/diff": "^4.0 || ^5.0", "symfony/console": "^5.4 || ^6.0", "symfony/event-dispatcher": "^5.4 || ^6.0", "symfony/filesystem": "^5.4 || ^6.0", "symfony/finder": "^5.4 || ^6.0", "symfony/options-resolver": "^5.4 || ^6.0", - "symfony/polyfill-mbstring": "^1.23", - "symfony/polyfill-php80": "^1.25", - "symfony/polyfill-php81": "^1.25", + "symfony/polyfill-mbstring": "^1.27", + "symfony/polyfill-php80": "^1.27", + "symfony/polyfill-php81": "^1.27", "symfony/process": "^5.4 || ^6.0", "symfony/stopwatch": "^5.4 || ^6.0" }, "require-dev": { + "facile-it/paraunit": "^1.3 || ^2.0", "justinrainbow/json-schema": "^5.2", "keradus/cli-executor": "^2.0", - "mikey179/vfsstream": "^1.6.10", - "php-coveralls/php-coveralls": "^2.5.2", + "mikey179/vfsstream": "^1.6.11", + "php-coveralls/php-coveralls": "^2.5.3", "php-cs-fixer/accessible-object": "^1.1", "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.2", "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.2.1", - "phpspec/prophecy": "^1.15", + "phpspec/prophecy": "^1.16", "phpspec/prophecy-phpunit": "^2.0", "phpunit/phpunit": "^9.5", - "phpunitgoodpractices/polyfill": "^1.6", - "phpunitgoodpractices/traits": "^1.9.2", - "symfony/phpunit-bridge": "^6.0", + "symfony/phpunit-bridge": "^6.2.3", "symfony/yaml": "^5.4 || ^6.0" }, "suggest": { @@ -451,9 +350,15 @@ } ], "description": "A tool to automatically fix PHP code style", + "keywords": [ + "Static code analysis", + "fixer", + "standards", + "static analysis" + ], "support": { "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", - "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.13.0" + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.35.1" }, "funding": [ { @@ -461,56 +366,7 @@ "type": "github" } ], - "time": "2022-10-31T19:28:50+00:00" - }, - { - "name": "psr/cache", - "version": "3.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/cache.git", - "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/cache/zipball/aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", - "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", - "shasum": "" - }, - "require": { - "php": ">=8.0.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Cache\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interface for caching libraries", - "keywords": [ - "cache", - "psr", - "psr-6" - ], - "support": { - "source": "https://github.com/php-fig/cache/tree/3.0.0" - }, - "time": "2021-02-03T23:26:27+00:00" + "time": "2023-10-12T13:47:26+00:00" }, { "name": "psr/container", @@ -667,29 +523,29 @@ }, { "name": "sebastian/diff", - "version": "4.0.4", + "version": "5.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d" + "reference": "912dc2fbe3e3c1e7873313cc801b100b6c68c87b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d", - "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/912dc2fbe3e3c1e7873313cc801b100b6c68c87b", + "reference": "912dc2fbe3e3c1e7873313cc801b100b6c68c87b", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3", + "phpunit/phpunit": "^10.0", "symfony/process": "^4.2 || ^5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -721,7 +577,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/4.0.4" + "security": "https://github.com/sebastianbergmann/diff/security/policy", + "source": "https://github.com/sebastianbergmann/diff/tree/5.0.3" }, "funding": [ { @@ -729,27 +586,27 @@ "type": "github" } ], - "time": "2020-10-26T13:10:38+00:00" + "time": "2023-05-01T07:48:21+00:00" }, { "name": "symfony/console", - "version": "v6.1.7", + "version": "v6.3.4", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "a1282bd0c096e0bdb8800b104177e2ce404d8815" + "reference": "eca495f2ee845130855ddf1cf18460c38966c8b6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/a1282bd0c096e0bdb8800b104177e2ce404d8815", - "reference": "a1282bd0c096e0bdb8800b104177e2ce404d8815", + "url": "https://api.github.com/repos/symfony/console/zipball/eca495f2ee845130855ddf1cf18460c38966c8b6", + "reference": "eca495f2ee845130855ddf1cf18460c38966c8b6", "shasum": "" }, "require": { "php": ">=8.1", - "symfony/deprecation-contracts": "^2.1|^3", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-mbstring": "~1.0", - "symfony/service-contracts": "^1.1|^2|^3", + "symfony/service-contracts": "^2.5|^3", "symfony/string": "^5.4|^6.0" }, "conflict": { @@ -771,12 +628,6 @@ "symfony/process": "^5.4|^6.0", "symfony/var-dumper": "^5.4|^6.0" }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/lock": "", - "symfony/process": "" - }, "type": "library", "autoload": { "psr-4": { @@ -804,12 +655,12 @@ "homepage": "https://symfony.com", "keywords": [ "cli", - "command line", + "command-line", "console", "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.1.7" + "source": "https://github.com/symfony/console/tree/v6.3.4" }, "funding": [ { @@ -825,20 +676,20 @@ "type": "tidelift" } ], - "time": "2022-10-26T21:42:49+00:00" + "time": "2023-08-16T10:10:12+00:00" }, { "name": "symfony/deprecation-contracts", - "version": "v3.1.1", + "version": "v3.3.0", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918" + "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918", - "reference": "07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/7c3aff79d10325257a001fcf92d991f24fc967cf", + "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf", "shasum": "" }, "require": { @@ -847,7 +698,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "3.1-dev" + "dev-main": "3.4-dev" }, "thanks": { "name": "symfony/contracts", @@ -876,7 +727,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.1.1" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.3.0" }, "funding": [ { @@ -892,28 +743,29 @@ "type": "tidelift" } ], - "time": "2022-02-25T11:15:52+00:00" + "time": "2023-05-23T14:45:45+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v6.1.0", + "version": "v6.3.2", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "a0449a7ad7daa0f7c0acd508259f80544ab5a347" + "reference": "adb01fe097a4ee930db9258a3cc906b5beb5cf2e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/a0449a7ad7daa0f7c0acd508259f80544ab5a347", - "reference": "a0449a7ad7daa0f7c0acd508259f80544ab5a347", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/adb01fe097a4ee930db9258a3cc906b5beb5cf2e", + "reference": "adb01fe097a4ee930db9258a3cc906b5beb5cf2e", "shasum": "" }, "require": { "php": ">=8.1", - "symfony/event-dispatcher-contracts": "^2|^3" + "symfony/event-dispatcher-contracts": "^2.5|^3" }, "conflict": { - "symfony/dependency-injection": "<5.4" + "symfony/dependency-injection": "<5.4", + "symfony/service-contracts": "<2.5" }, "provide": { "psr/event-dispatcher-implementation": "1.0", @@ -926,13 +778,9 @@ "symfony/error-handler": "^5.4|^6.0", "symfony/expression-language": "^5.4|^6.0", "symfony/http-foundation": "^5.4|^6.0", - "symfony/service-contracts": "^1.1|^2|^3", + "symfony/service-contracts": "^2.5|^3", "symfony/stopwatch": "^5.4|^6.0" }, - "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" - }, "type": "library", "autoload": { "psr-4": { @@ -959,7 +807,7 @@ "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/v6.1.0" + "source": "https://github.com/symfony/event-dispatcher/tree/v6.3.2" }, "funding": [ { @@ -975,33 +823,30 @@ "type": "tidelift" } ], - "time": "2022-05-05T16:51:07+00:00" + "time": "2023-07-06T06:56:43+00:00" }, { "name": "symfony/event-dispatcher-contracts", - "version": "v3.1.1", + "version": "v3.3.0", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "02ff5eea2f453731cfbc6bc215e456b781480448" + "reference": "a76aed96a42d2b521153fb382d418e30d18b59df" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/02ff5eea2f453731cfbc6bc215e456b781480448", - "reference": "02ff5eea2f453731cfbc6bc215e456b781480448", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/a76aed96a42d2b521153fb382d418e30d18b59df", + "reference": "a76aed96a42d2b521153fb382d418e30d18b59df", "shasum": "" }, "require": { "php": ">=8.1", "psr/event-dispatcher": "^1" }, - "suggest": { - "symfony/event-dispatcher-implementation": "" - }, "type": "library", "extra": { "branch-alias": { - "dev-main": "3.1-dev" + "dev-main": "3.4-dev" }, "thanks": { "name": "symfony/contracts", @@ -1038,7 +883,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.1.1" + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.3.0" }, "funding": [ { @@ -1054,20 +899,20 @@ "type": "tidelift" } ], - "time": "2022-02-25T11:15:52+00:00" + "time": "2023-05-23T14:45:45+00:00" }, { "name": "symfony/filesystem", - "version": "v6.1.5", + "version": "v6.3.1", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "4d216a2beef096edf040a070117c39ca2abce307" + "reference": "edd36776956f2a6fcf577edb5b05eb0e3bdc52ae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/4d216a2beef096edf040a070117c39ca2abce307", - "reference": "4d216a2beef096edf040a070117c39ca2abce307", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/edd36776956f2a6fcf577edb5b05eb0e3bdc52ae", + "reference": "edd36776956f2a6fcf577edb5b05eb0e3bdc52ae", "shasum": "" }, "require": { @@ -1101,7 +946,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v6.1.5" + "source": "https://github.com/symfony/filesystem/tree/v6.3.1" }, "funding": [ { @@ -1117,20 +962,20 @@ "type": "tidelift" } ], - "time": "2022-09-21T20:29:40+00:00" + "time": "2023-06-01T08:30:39+00:00" }, { "name": "symfony/finder", - "version": "v6.1.3", + "version": "v6.3.5", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "39696bff2c2970b3779a5cac7bf9f0b88fc2b709" + "reference": "a1b31d88c0e998168ca7792f222cbecee47428c4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/39696bff2c2970b3779a5cac7bf9f0b88fc2b709", - "reference": "39696bff2c2970b3779a5cac7bf9f0b88fc2b709", + "url": "https://api.github.com/repos/symfony/finder/zipball/a1b31d88c0e998168ca7792f222cbecee47428c4", + "reference": "a1b31d88c0e998168ca7792f222cbecee47428c4", "shasum": "" }, "require": { @@ -1165,7 +1010,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v6.1.3" + "source": "https://github.com/symfony/finder/tree/v6.3.5" }, "funding": [ { @@ -1181,25 +1026,25 @@ "type": "tidelift" } ], - "time": "2022-07-29T07:42:06+00:00" + "time": "2023-09-26T12:56:25+00:00" }, { "name": "symfony/options-resolver", - "version": "v6.1.0", + "version": "v6.3.0", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "a3016f5442e28386ded73c43a32a5b68586dd1c4" + "reference": "a10f19f5198d589d5c33333cffe98dc9820332dd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/a3016f5442e28386ded73c43a32a5b68586dd1c4", - "reference": "a3016f5442e28386ded73c43a32a5b68586dd1c4", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/a10f19f5198d589d5c33333cffe98dc9820332dd", + "reference": "a10f19f5198d589d5c33333cffe98dc9820332dd", "shasum": "" }, "require": { "php": ">=8.1", - "symfony/deprecation-contracts": "^2.1|^3" + "symfony/deprecation-contracts": "^2.5|^3" }, "type": "library", "autoload": { @@ -1232,7 +1077,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v6.1.0" + "source": "https://github.com/symfony/options-resolver/tree/v6.3.0" }, "funding": [ { @@ -1248,20 +1093,20 @@ "type": "tidelift" } ], - "time": "2022-02-25T11:15:52+00:00" + "time": "2023-05-12T14:21:09+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.26.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4" + "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4", - "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", + "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", "shasum": "" }, "require": { @@ -1276,7 +1121,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1314,7 +1159,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.28.0" }, "funding": [ { @@ -1330,20 +1175,20 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.26.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "433d05519ce6990bf3530fba6957499d327395c2" + "reference": "875e90aeea2777b6f135677f618529449334a612" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/433d05519ce6990bf3530fba6957499d327395c2", - "reference": "433d05519ce6990bf3530fba6957499d327395c2", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/875e90aeea2777b6f135677f618529449334a612", + "reference": "875e90aeea2777b6f135677f618529449334a612", "shasum": "" }, "require": { @@ -1355,7 +1200,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1395,7 +1240,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.28.0" }, "funding": [ { @@ -1411,20 +1256,20 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.26.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "219aa369ceff116e673852dce47c3a41794c14bd" + "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/219aa369ceff116e673852dce47c3a41794c14bd", - "reference": "219aa369ceff116e673852dce47c3a41794c14bd", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", + "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", "shasum": "" }, "require": { @@ -1436,7 +1281,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1479,7 +1324,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.28.0" }, "funding": [ { @@ -1495,20 +1340,20 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.26.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e" + "reference": "42292d99c55abe617799667f454222c54c60e229" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", - "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/42292d99c55abe617799667f454222c54c60e229", + "reference": "42292d99c55abe617799667f454222c54c60e229", "shasum": "" }, "require": { @@ -1523,7 +1368,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1562,7 +1407,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.28.0" }, "funding": [ { @@ -1578,20 +1423,20 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2023-07-28T09:04:16+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.26.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace" + "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/cfa0ae98841b9e461207c13ab093d76b0fa7bace", - "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/6caa57379c4aec19c0a12a38b59b26487dcfe4b5", + "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5", "shasum": "" }, "require": { @@ -1600,7 +1445,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1645,7 +1490,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.28.0" }, "funding": [ { @@ -1661,20 +1506,20 @@ "type": "tidelift" } ], - "time": "2022-05-10T07:21:04+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-php81", - "version": "v1.26.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "13f6d1271c663dc5ae9fb843a8f16521db7687a1" + "reference": "7581cd600fa9fd681b797d00b02f068e2f13263b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/13f6d1271c663dc5ae9fb843a8f16521db7687a1", - "reference": "13f6d1271c663dc5ae9fb843a8f16521db7687a1", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/7581cd600fa9fd681b797d00b02f068e2f13263b", + "reference": "7581cd600fa9fd681b797d00b02f068e2f13263b", "shasum": "" }, "require": { @@ -1683,7 +1528,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1724,7 +1569,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.28.0" }, "funding": [ { @@ -1740,20 +1585,20 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/process", - "version": "v6.1.3", + "version": "v6.3.4", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "a6506e99cfad7059b1ab5cab395854a0a0c21292" + "reference": "0b5c29118f2e980d455d2e34a5659f4579847c54" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/a6506e99cfad7059b1ab5cab395854a0a0c21292", - "reference": "a6506e99cfad7059b1ab5cab395854a0a0c21292", + "url": "https://api.github.com/repos/symfony/process/zipball/0b5c29118f2e980d455d2e34a5659f4579847c54", + "reference": "0b5c29118f2e980d455d2e34a5659f4579847c54", "shasum": "" }, "require": { @@ -1785,7 +1630,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v6.1.3" + "source": "https://github.com/symfony/process/tree/v6.3.4" }, "funding": [ { @@ -1801,20 +1646,20 @@ "type": "tidelift" } ], - "time": "2022-06-27T17:24:16+00:00" + "time": "2023-08-07T10:39:22+00:00" }, { "name": "symfony/service-contracts", - "version": "v3.1.1", + "version": "v3.3.0", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "925e713fe8fcacf6bc05e936edd8dd5441a21239" + "reference": "40da9cc13ec349d9e4966ce18b5fbcd724ab10a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/925e713fe8fcacf6bc05e936edd8dd5441a21239", - "reference": "925e713fe8fcacf6bc05e936edd8dd5441a21239", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/40da9cc13ec349d9e4966ce18b5fbcd724ab10a4", + "reference": "40da9cc13ec349d9e4966ce18b5fbcd724ab10a4", "shasum": "" }, "require": { @@ -1824,13 +1669,10 @@ "conflict": { "ext-psr": "<1.1|>=2" }, - "suggest": { - "symfony/service-implementation": "" - }, "type": "library", "extra": { "branch-alias": { - "dev-main": "3.1-dev" + "dev-main": "3.4-dev" }, "thanks": { "name": "symfony/contracts", @@ -1870,7 +1712,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.1.1" + "source": "https://github.com/symfony/service-contracts/tree/v3.3.0" }, "funding": [ { @@ -1886,25 +1728,25 @@ "type": "tidelift" } ], - "time": "2022-05-30T19:18:58+00:00" + "time": "2023-05-23T14:45:45+00:00" }, { "name": "symfony/stopwatch", - "version": "v6.1.5", + "version": "v6.3.0", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "266636bb8f3fbdccc302491df7b3a1b9a8c238a7" + "reference": "fc47f1015ec80927ff64ba9094dfe8b9d48fe9f2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/266636bb8f3fbdccc302491df7b3a1b9a8c238a7", - "reference": "266636bb8f3fbdccc302491df7b3a1b9a8c238a7", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/fc47f1015ec80927ff64ba9094dfe8b9d48fe9f2", + "reference": "fc47f1015ec80927ff64ba9094dfe8b9d48fe9f2", "shasum": "" }, "require": { "php": ">=8.1", - "symfony/service-contracts": "^1|^2|^3" + "symfony/service-contracts": "^2.5|^3" }, "type": "library", "autoload": { @@ -1932,7 +1774,7 @@ "description": "Provides a way to profile code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/stopwatch/tree/v6.1.5" + "source": "https://github.com/symfony/stopwatch/tree/v6.3.0" }, "funding": [ { @@ -1948,20 +1790,20 @@ "type": "tidelift" } ], - "time": "2022-09-28T16:00:52+00:00" + "time": "2023-02-16T10:14:28+00:00" }, { "name": "symfony/string", - "version": "v6.1.7", + "version": "v6.3.5", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "823f143370880efcbdfa2dbca946b3358c4707e5" + "reference": "13d76d0fb049051ed12a04bef4f9de8715bea339" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/823f143370880efcbdfa2dbca946b3358c4707e5", - "reference": "823f143370880efcbdfa2dbca946b3358c4707e5", + "url": "https://api.github.com/repos/symfony/string/zipball/13d76d0fb049051ed12a04bef4f9de8715bea339", + "reference": "13d76d0fb049051ed12a04bef4f9de8715bea339", "shasum": "" }, "require": { @@ -1972,12 +1814,13 @@ "symfony/polyfill-mbstring": "~1.0" }, "conflict": { - "symfony/translation-contracts": "<2.0" + "symfony/translation-contracts": "<2.5" }, "require-dev": { "symfony/error-handler": "^5.4|^6.0", "symfony/http-client": "^5.4|^6.0", - "symfony/translation-contracts": "^2.0|^3.0", + "symfony/intl": "^6.2", + "symfony/translation-contracts": "^2.5|^3.0", "symfony/var-exporter": "^5.4|^6.0" }, "type": "library", @@ -2017,7 +1860,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.1.7" + "source": "https://github.com/symfony/string/tree/v6.3.5" }, "funding": [ { @@ -2033,57 +1876,7 @@ "type": "tidelift" } ], - "time": "2022-10-10T09:34:31+00:00" - }, - { - "name": "theofidry/php-cs-fixer-config", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/theofidry/php-cs-fixer-config.git", - "reference": "9dd265fc36006f2d5b165e18a9e15411230512cf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/theofidry/php-cs-fixer-config/zipball/9dd265fc36006f2d5b165e18a9e15411230512cf", - "reference": "9dd265fc36006f2d5b165e18a9e15411230512cf", - "shasum": "" - }, - "require": { - "php": "^7.4 || ^8.0" - }, - "conflict": { - "friendsofphp/php-cs-fixer": "<3.0,>=4.0", - "phpunit/phpunit": "<9.4.3" - }, - "require-dev": { - "ergebnis/composer-normalize": "~2.13.0", - "friendsofphp/php-cs-fixer": "^3.8", - "phpunit/phpunit": "^9.5", - "symfony/filesystem": "^5.4" - }, - "type": "library", - "autoload": { - "psr-4": { - "Fidry\\PhpCsFixerConfig\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Théo FIDRY", - "email": "theo.fidry@gmail.com" - } - ], - "description": "The PHP-CS-Fixer default config for my projects", - "support": { - "issues": "https://github.com/theofidry/php-cs-fixer-config/issues", - "source": "https://github.com/theofidry/php-cs-fixer-config/tree/1.0.1" - }, - "time": "2022-10-12T20:33:56+00:00" + "time": "2023-09-18T10:38:32+00:00" } ], "aliases": [], @@ -2093,5 +1886,5 @@ "prefer-lowest": false, "platform": [], "platform-dev": [], - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.6.0" } From 6163e766a2e67f0a1fb2a43877b6d36877ced85d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20FIDRY?= <5175937+theofidry@users.noreply.github.com> Date: Sat, 14 Oct 2023 00:49:30 +0200 Subject: [PATCH 3/7] chore: Allow fidry/console 0.6 (#851) --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 28ac692f..bee6d000 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ ], "require": { "php": "^8.1", - "fidry/console": "^0.5.0", + "fidry/console": "^0.5.0 || ^0.6.0", "jetbrains/phpstorm-stubs": "^v2022.2", "nikic/php-parser": "^4.12", "symfony/console": "^5.2 || ^6.0", From bf1ec1d5d2ad372e08506a3b6befe8b3847d90ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20FIDRY?= <5175937+theofidry@users.noreply.github.com> Date: Sat, 14 Oct 2023 00:56:39 +0200 Subject: [PATCH 4/7] ci: Configure the concurrency of the jobs (#853) --- .github/workflows/composer-root-version.yaml | 5 +++++ .github/workflows/e2e-tests.yaml | 5 +++++ .github/workflows/lint.yaml | 5 +++++ .github/workflows/release.yaml | 5 +++++ .github/workflows/security.yaml | 5 +++++ .github/workflows/tests.yaml | 5 +++++ 6 files changed, 30 insertions(+) diff --git a/.github/workflows/composer-root-version.yaml b/.github/workflows/composer-root-version.yaml index f230596d..8daff7ef 100644 --- a/.github/workflows/composer-root-version.yaml +++ b/.github/workflows/composer-root-version.yaml @@ -5,6 +5,11 @@ on: branches: [ main ] pull_request: +# See https://stackoverflow.com/a/72408109 +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: cs-lint: runs-on: ubuntu-latest diff --git a/.github/workflows/e2e-tests.yaml b/.github/workflows/e2e-tests.yaml index d3ea23fa..78d92d79 100644 --- a/.github/workflows/e2e-tests.yaml +++ b/.github/workflows/e2e-tests.yaml @@ -7,6 +7,11 @@ on: release: types: [ created ] +# See https://stackoverflow.com/a/72408109 +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: build-test-phar: runs-on: ubuntu-latest diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 14c315dc..737eea21 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -5,6 +5,11 @@ on: branches: [ main ] pull_request: +# See https://stackoverflow.com/a/72408109 +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: cs: runs-on: ubuntu-latest diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index b675fba6..636dd829 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -7,6 +7,11 @@ on: release: types: [ created ] +# See https://stackoverflow.com/a/72408109 +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: build-phar: runs-on: ubuntu-latest diff --git a/.github/workflows/security.yaml b/.github/workflows/security.yaml index 8d4367ae..0bdf9c29 100644 --- a/.github/workflows/security.yaml +++ b/.github/workflows/security.yaml @@ -7,6 +7,11 @@ on: release: types: [ created ] +# See https://stackoverflow.com/a/72408109 +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: security: runs-on: ubuntu-latest diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index f11b74ec..c04f1b47 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -7,6 +7,11 @@ on: release: types: [ created ] +# See https://stackoverflow.com/a/72408109 +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: root-version: runs-on: ubuntu-latest From 3c938bb1243237ced2bfdfd714d02011250bf112 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20FIDRY?= <5175937+theofidry@users.noreply.github.com> Date: Sat, 14 Oct 2023 01:05:06 +0200 Subject: [PATCH 5/7] refactor: Leverage FidryFileSystem (#852) --- composer.json | 1 + composer.lock | 123 ++++++++++++++---- .../ConfigurationFactoryTest.php | 4 +- .../Console/Command/AddPrefixCommandTest.php | 42 +++--- tests/FileSystemTestCase.php | 35 +---- tests/functions.php | 66 ---------- 6 files changed, 124 insertions(+), 147 deletions(-) diff --git a/composer.json b/composer.json index bee6d000..75242c8f 100644 --- a/composer.json +++ b/composer.json @@ -19,6 +19,7 @@ "require": { "php": "^8.1", "fidry/console": "^0.5.0 || ^0.6.0", + "fidry/filesystem": "^1.1", "jetbrains/phpstorm-stubs": "^v2022.2", "nikic/php-parser": "^4.12", "symfony/console": "^5.2 || ^6.0", diff --git a/composer.lock b/composer.lock index 79225acf..c07b5063 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": "2244bb644c3c3ab01f4a74616dd5a288", + "content-hash": "3a91c4aeab38b553f08275f378b3b1f3", "packages": [ { "name": "fidry/console", @@ -90,6 +90,75 @@ ], "time": "2022-12-18T10:49:34+00:00" }, + { + "name": "fidry/filesystem", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/theofidry/filesystem.git", + "reference": "1dd372ab3eb8b84ffe9578bff576b00c9a44ee46" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theofidry/filesystem/zipball/1dd372ab3eb8b84ffe9578bff576b00c9a44ee46", + "reference": "1dd372ab3eb8b84ffe9578bff576b00c9a44ee46", + "shasum": "" + }, + "require": { + "php": "^8.1", + "symfony/filesystem": "^6.3", + "thecodingmachine/safe": "^2.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.4", + "ergebnis/composer-normalize": "^2.28", + "infection/infection": "^0.26", + "phpspec/prophecy-phpunit": "^2.0", + "phpunit/phpunit": "^10.3", + "symfony/finder": "^6.3", + "symfony/phpunit-bridge": "^6.2" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": false, + "forward-command": false + }, + "branch-alias": { + "dev-main": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Fidry\\FileSystem\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Théo Fidry", + "email": "theo.fidry@gmail.com" + } + ], + "description": "Symfony Filesystem with a few more utilities.", + "keywords": [ + "filesystem" + ], + "support": { + "issues": "https://github.com/theofidry/filesystem/issues", + "source": "https://github.com/theofidry/filesystem/tree/1.1.0" + }, + "funding": [ + { + "url": "https://github.com/theofidry", + "type": "github" + } + ], + "time": "2023-10-07T07:32:54+00:00" + }, { "name": "jetbrains/phpstorm-stubs", "version": "v2022.3", @@ -541,16 +610,16 @@ }, { "name": "symfony/filesystem", - "version": "v6.2.7", + "version": "v6.3.1", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "82b6c62b959f642d000456f08c6d219d749215b3" + "reference": "edd36776956f2a6fcf577edb5b05eb0e3bdc52ae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/82b6c62b959f642d000456f08c6d219d749215b3", - "reference": "82b6c62b959f642d000456f08c6d219d749215b3", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/edd36776956f2a6fcf577edb5b05eb0e3bdc52ae", + "reference": "edd36776956f2a6fcf577edb5b05eb0e3bdc52ae", "shasum": "" }, "require": { @@ -584,7 +653,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v6.2.7" + "source": "https://github.com/symfony/filesystem/tree/v6.3.1" }, "funding": [ { @@ -600,7 +669,7 @@ "type": "tidelift" } ], - "time": "2023-02-14T08:44:56+00:00" + "time": "2023-06-01T08:30:39+00:00" }, { "name": "symfony/finder", @@ -668,16 +737,16 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "5bbc823adecdae860bb64756d639ecfec17b050a" + "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a", - "reference": "5bbc823adecdae860bb64756d639ecfec17b050a", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", + "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", "shasum": "" }, "require": { @@ -692,7 +761,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -730,7 +799,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.28.0" }, "funding": [ { @@ -746,7 +815,7 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-intl-grapheme", @@ -915,16 +984,16 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534" + "reference": "42292d99c55abe617799667f454222c54c60e229" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534", - "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/42292d99c55abe617799667f454222c54c60e229", + "reference": "42292d99c55abe617799667f454222c54c60e229", "shasum": "" }, "require": { @@ -939,7 +1008,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -978,7 +1047,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.28.0" }, "funding": [ { @@ -994,7 +1063,7 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-07-28T09:04:16+00:00" }, { "name": "symfony/service-contracts", @@ -1169,16 +1238,16 @@ }, { "name": "thecodingmachine/safe", - "version": "v2.4.0", + "version": "v2.5.0", "source": { "type": "git", "url": "https://github.com/thecodingmachine/safe.git", - "reference": "e788f3d09dcd36f806350aedb77eac348fafadd3" + "reference": "3115ecd6b4391662b4931daac4eba6b07a2ac1f0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thecodingmachine/safe/zipball/e788f3d09dcd36f806350aedb77eac348fafadd3", - "reference": "e788f3d09dcd36f806350aedb77eac348fafadd3", + "url": "https://api.github.com/repos/thecodingmachine/safe/zipball/3115ecd6b4391662b4931daac4eba6b07a2ac1f0", + "reference": "3115ecd6b4391662b4931daac4eba6b07a2ac1f0", "shasum": "" }, "require": { @@ -1302,9 +1371,9 @@ "description": "PHP core functions that throw exceptions instead of returning FALSE on error", "support": { "issues": "https://github.com/thecodingmachine/safe/issues", - "source": "https://github.com/thecodingmachine/safe/tree/v2.4.0" + "source": "https://github.com/thecodingmachine/safe/tree/v2.5.0" }, - "time": "2022-10-07T14:02:17+00:00" + "time": "2023-04-05T11:54:14+00:00" }, { "name": "webmozart/assert", diff --git a/tests/Configuration/ConfigurationFactoryTest.php b/tests/Configuration/ConfigurationFactoryTest.php index 968e91b9..4ce49f11 100644 --- a/tests/Configuration/ConfigurationFactoryTest.php +++ b/tests/Configuration/ConfigurationFactoryTest.php @@ -14,6 +14,7 @@ namespace Humbug\PhpScoper\Configuration; +use Fidry\FileSystem\FS; use Humbug\PhpScoper\Container; use Humbug\PhpScoper\FileSystemTestCase; use Humbug\PhpScoper\Patcher\ComposerPatcher; @@ -24,7 +25,6 @@ use Humbug\PhpScoper\Symbol\SymbolRegistry; use InvalidArgumentException; use function array_keys; -use function KevinGH\Box\FileSystem\dump_file; use function Safe\touch; use const DIRECTORY_SEPARATOR; @@ -168,7 +168,7 @@ public function test_it_can_create_a_complete_configuration(): void private static function dumpStandardConfigFile(string $contents): void { - dump_file('scoper.inc.php', $contents); + FS::dumpFile('scoper.inc.php', $contents); } private function createConfigFromStandardFile(): Configuration diff --git a/tests/Console/Command/AddPrefixCommandTest.php b/tests/Console/Command/AddPrefixCommandTest.php index 0e041397..4d5b8f5d 100644 --- a/tests/Console/Command/AddPrefixCommandTest.php +++ b/tests/Console/Command/AddPrefixCommandTest.php @@ -16,6 +16,7 @@ use Fidry\Console\Application\SymfonyApplication; use Fidry\Console\Command\SymfonyCommand; +use Fidry\FileSystem\FS; use Humbug\PhpScoper\Configuration\ConfigurationFactory; use Humbug\PhpScoper\Configuration\RegexChecker; use Humbug\PhpScoper\Configuration\SymbolsConfigurationFactory; @@ -38,7 +39,6 @@ use Symfony\Component\Console\Tester\ApplicationTester; use Symfony\Component\Filesystem\Filesystem; use function count; -use function Humbug\PhpScoper\escape_path; use function Safe\chdir; use function Safe\file_get_contents; use function Safe\realpath; @@ -121,8 +121,8 @@ public function test_scope_the_given_paths(): void ->shouldBeCalled(); foreach ($expectedFiles as $expectedFile => $prefixedContents) { - $inputPath = escape_path($root.'/'.$expectedFile); - $outputPath = escape_path($this->tmp.'/'.$expectedFile); + $inputPath = FS::escapePath($root.'/'.$expectedFile); + $outputPath = FS::escapePath($this->tmp.'/'.$expectedFile); $inputContents = file_get_contents($inputPath); @@ -183,8 +183,8 @@ public function test_let_the_file_unchanged_when_cannot_scope_a_file(): void ->shouldBeCalled(); foreach ($expectedFiles as $expectedFile => $prefixedContents) { - $inputPath = escape_path($root.'/'.$expectedFile); - $outputPath = escape_path($this->tmp.'/'.$expectedFile); + $inputPath = FS::escapePath($root.'/'.$expectedFile); + $outputPath = FS::escapePath($this->tmp.'/'.$expectedFile); $inputContents = file_get_contents($inputPath); @@ -239,8 +239,8 @@ public function test_do_not_scope_duplicated_given_paths(): void ]; foreach ($expectedFiles as $expectedFile => $prefixedContents) { - $inputPath = escape_path($root.'/'.$expectedFile); - $outputPath = escape_path($this->tmp.'/'.$expectedFile); + $inputPath = FS::escapePath($root.'/'.$expectedFile); + $outputPath = FS::escapePath($this->tmp.'/'.$expectedFile); $inputContents = file_get_contents($inputPath); @@ -262,7 +262,7 @@ public function test_do_not_scope_duplicated_given_paths(): void public function test_scope_the_given_paths_and_the_ones_found_by_the_finder(): void { - chdir($rootPath = escape_path(self::FIXTURE_PATH.'/set012')); + chdir($rootPath = FS::escapePath(self::FIXTURE_PATH.'/set012')); $input = [ 'add-prefix', @@ -289,7 +289,7 @@ public function test_scope_the_given_paths_and_the_ones_found_by_the_finder(): v foreach ($expectedFiles as $inputPath => $outputPath) { $inputPath = realpath($inputPath); - $outputPath = escape_path($outputPath); + $outputPath = FS::escapePath($outputPath); $inputContents = file_get_contents($inputPath); $prefixedFileContents = 'Random string'; @@ -347,8 +347,8 @@ public function test_scope_the_current_working_directory_if_no_path_given(): voi ->shouldBeCalled(); foreach ($expectedFiles as $expectedFile => $prefixedContents) { - $inputPath = escape_path($root.'/'.$expectedFile); - $outputPath = escape_path($this->tmp.'/'.$expectedFile); + $inputPath = FS::escapePath($root.'/'.$expectedFile); + $outputPath = FS::escapePath($this->tmp.'/'.$expectedFile); $inputContents = file_get_contents($inputPath); @@ -405,8 +405,8 @@ public function test_an_output_directory_can_be_given(): void ->shouldBeCalled(); foreach ($expectedFiles as $expectedFile => $prefixedContents) { - $inputPath = escape_path($root.'/'.$expectedFile); - $outputPath = escape_path($outDir.'/'.$expectedFile); + $inputPath = FS::escapePath($root.'/'.$expectedFile); + $outputPath = FS::escapePath($outDir.'/'.$expectedFile); $inputContents = file_get_contents($inputPath); @@ -464,8 +464,8 @@ public function test_relative_output_directory_are_made_absolute(): void ->shouldBeCalled(); foreach ($expectedFiles as $expectedFile => $prefixedContents) { - $inputPath = escape_path($root.'/'.$expectedFile); - $outputPath = escape_path($this->tmp.DIRECTORY_SEPARATOR.$outDir.'/'.$expectedFile); + $inputPath = FS::escapePath($root.'/'.$expectedFile); + $outputPath = FS::escapePath($this->tmp.DIRECTORY_SEPARATOR.$outDir.'/'.$expectedFile); $inputContents = file_get_contents($inputPath); @@ -520,7 +520,7 @@ public function test_throws_an_error_when_passing_a_non_existent_config(): void public function test_throws_an_error_if_patch_file_returns_an_array_with_invalid_values(): void { - chdir(escape_path(self::FIXTURE_PATH.'/set009')); + chdir(FS::escapePath(self::FIXTURE_PATH.'/set009')); $input = [ 'add-prefix', @@ -551,7 +551,7 @@ public function test_throws_an_error_if_patch_file_returns_an_array_with_invalid public function test_can_scope_projects_with_invalid_files(): void { - chdir(escape_path($root = self::FIXTURE_PATH.'/set010')); + chdir(FS::escapePath($root = self::FIXTURE_PATH.'/set010')); $input = [ 'add-prefix', @@ -575,8 +575,8 @@ public function test_can_scope_projects_with_invalid_files(): void $root = realpath($root); foreach ($expectedFiles as $expectedFile => $prefixedContents) { - $inputPath = escape_path($root.'/'.$expectedFile); - $outputPath = escape_path($this->tmp.'/'.$expectedFile); + $inputPath = FS::escapePath($root.'/'.$expectedFile); + $outputPath = FS::escapePath($this->tmp.'/'.$expectedFile); $fileContents = file_get_contents($inputPath); @@ -635,8 +635,8 @@ public function test_it_outputs_in_the_build_directory_if_no_output_dir_is_given ->shouldBeCalled(); foreach ($expectedFiles as $expectedFile => $prefixedContents) { - $inputPath = escape_path($root.'/'.$expectedFile); - $outputPath = escape_path($this->tmp.DIRECTORY_SEPARATOR.$outDir.'/'.$expectedFile); + $inputPath = FS::escapePath($root.'/'.$expectedFile); + $outputPath = FS::escapePath($this->tmp.DIRECTORY_SEPARATOR.$outDir.'/'.$expectedFile); $inputContents = file_get_contents($inputPath); diff --git a/tests/FileSystemTestCase.php b/tests/FileSystemTestCase.php index b31b9280..a4808562 100644 --- a/tests/FileSystemTestCase.php +++ b/tests/FileSystemTestCase.php @@ -14,39 +14,12 @@ namespace Humbug\PhpScoper; -use PHPUnit\Framework\TestCase; -use function Safe\chdir; -use function Safe\getcwd; -use function Safe\realpath; -use function str_replace; -use function sys_get_temp_dir; +use Fidry\FileSystem\Test\FileSystemTestCase as FidryFileSystemTestCase; -abstract class FileSystemTestCase extends TestCase +abstract class FileSystemTestCase extends FidryFileSystemTestCase { - protected string $cwd; - - protected string $tmp; - - protected function setUp(): void - { - parent::setUp(); - - // Cleans up whatever was there before. Indeed upon failure PHPUnit fails to trigger the `tearDown()` method - // and as a result some temporary files may still remain. - remove_dir(str_replace('\\', '/', realpath(sys_get_temp_dir())).'/php-scoper'); - - $this->cwd = getcwd(); - $this->tmp = make_tmp_dir('php-scoper', self::class); - - chdir($this->tmp); - } - - protected function tearDown(): void + public static function getTmpDirNamespace(): string { - parent::tearDown(); - - chdir($this->cwd); - - remove_dir($this->tmp); + return 'PHP-Scoper'; } } diff --git a/tests/functions.php b/tests/functions.php index 17ffb926..94e4fec2 100644 --- a/tests/functions.php +++ b/tests/functions.php @@ -15,72 +15,6 @@ namespace Humbug\PhpScoper; use PhpParser\Parser; -use RuntimeException; -use Symfony\Component\Filesystem\Filesystem; -use function mkdir as native_mkdir; -use function Safe\realpath; -use function sprintf; -use function str_replace; -use function strrpos; -use function substr; -use function sys_get_temp_dir; -use const DIRECTORY_SEPARATOR; - -/** - * Creates a temporary directory. - * - * @param string $namespace The directory path in the system's temporary - * directory. - * @param string $className The name of the test class. - * - * @return string The path to the created directory. - */ -function make_tmp_dir(string $namespace, string $className): string -{ - if (false !== ($pos = strrpos($className, '\\'))) { - $shortClass = substr($className, $pos + 1); - } else { - $shortClass = $className; - } - - // Usage of realpath() is important if the temporary directory is a - // symlink to another directory (e.g. /var => /private/var on some Macs) - // We want to know the real path to avoid comparison failures with - // code that uses real paths only - $systemTempDir = str_replace('\\', '/', realpath(sys_get_temp_dir())); - $basePath = $systemTempDir.'/'.$namespace.'/'.$shortClass; - - $i = 0; - - while (false === @native_mkdir($tempDir = escape_path($basePath.random_int(10000, 99999)), 0o777, true)) { - // Run until we are able to create a directory - if ($i > 100) { - throw new RuntimeException( - sprintf( - 'Could not create temporary directory for "%s:%s" after 100 attempts', - $namespace, - $className, - ), - ); - } - - ++$i; - } - - return $tempDir; -} - -function escape_path(string $path): string -{ - return str_replace('/', DIRECTORY_SEPARATOR, $path); -} - -function remove_dir(string $path): void -{ - $path = escape_path($path); - - (new Filesystem())->remove($path); -} /** * @private From b6f668d98665f919a0c6f334fbfb2b0559837751 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20FIDRY?= <5175937+theofidry@users.noreply.github.com> Date: Sat, 14 Oct 2023 01:05:53 +0200 Subject: [PATCH 6/7] ci: Add monthly schedule (#854) --- .github/workflows/composer-root-version.yaml | 6 +++++- .github/workflows/e2e-tests.yaml | 6 +++++- .github/workflows/lint.yaml | 6 +++++- .github/workflows/release.yaml | 6 +++++- .github/workflows/security.yaml | 5 ++++- .github/workflows/tests.yaml | 8 ++++++-- 6 files changed, 30 insertions(+), 7 deletions(-) diff --git a/.github/workflows/composer-root-version.yaml b/.github/workflows/composer-root-version.yaml index 8daff7ef..e88b0e1c 100644 --- a/.github/workflows/composer-root-version.yaml +++ b/.github/workflows/composer-root-version.yaml @@ -3,7 +3,11 @@ name: RootVersionChecker on: push: branches: [ main ] - pull_request: + pull_request: ~ + +schedule: + # Do not make it the first of the month and/or midnight since it is a very busy time + - cron: "* 10 5 * *" # See https://stackoverflow.com/a/72408109 concurrency: diff --git a/.github/workflows/e2e-tests.yaml b/.github/workflows/e2e-tests.yaml index 78d92d79..1e105a71 100644 --- a/.github/workflows/e2e-tests.yaml +++ b/.github/workflows/e2e-tests.yaml @@ -3,10 +3,14 @@ name: End-to-End Tests on: push: branches: [ main ] - pull_request: + pull_request: ~ release: types: [ created ] +schedule: + # Do not make it the first of the month and/or midnight since it is a very busy time + - cron: "* 10 5 * *" + # See https://stackoverflow.com/a/72408109 concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 737eea21..a6f2dff8 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -3,7 +3,11 @@ name: Lint on: push: branches: [ main ] - pull_request: + pull_request: ~ + +schedule: + # Do not make it the first of the month and/or midnight since it is a very busy time + - cron: "* 10 5 * *" # See https://stackoverflow.com/a/72408109 concurrency: diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 636dd829..59a30db2 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -3,10 +3,14 @@ name: Release on: push: branches: [ main ] - pull_request: + pull_request: ~ release: types: [ created ] +schedule: + # Do not make it the first of the month and/or midnight since it is a very busy time + - cron: "* 10 5 * *" + # See https://stackoverflow.com/a/72408109 concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} diff --git a/.github/workflows/security.yaml b/.github/workflows/security.yaml index 0bdf9c29..3df94d75 100644 --- a/.github/workflows/security.yaml +++ b/.github/workflows/security.yaml @@ -3,9 +3,12 @@ name: Security on: push: branches: [ main ] - pull_request: + pull_request: ~ release: types: [ created ] +schedule: + # Do not make it the first of the month and/or midnight since it is a very busy time + - cron: "* 10 5 * *" # See https://stackoverflow.com/a/72408109 concurrency: diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index c04f1b47..8a9af362 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -3,9 +3,13 @@ name: Tests on: push: branches: [ main ] - pull_request: + pull_request: ~ release: - types: [ created ] + types: [ created ] ~ + +schedule: + # Do not make it the first of the month and/or midnight since it is a very busy time + - cron: "* 10 5 * *" # See https://stackoverflow.com/a/72408109 concurrency: From af0684eb27cac99a2300e4daa005724c3839fa7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20FIDRY?= <5175937+theofidry@users.noreply.github.com> Date: Sat, 14 Oct 2023 10:35:02 +0200 Subject: [PATCH 7/7] ci: Fix workflow configuration (#855) --- .github/workflows/composer-root-version.yaml | 7 +++---- .github/workflows/e2e-tests.yaml | 7 +++---- .github/workflows/lint.yaml | 7 +++---- .github/workflows/release.yaml | 7 +++---- .github/workflows/security.yaml | 6 +++--- .github/workflows/tests.yaml | 7 +++---- 6 files changed, 18 insertions(+), 23 deletions(-) diff --git a/.github/workflows/composer-root-version.yaml b/.github/workflows/composer-root-version.yaml index e88b0e1c..28071e0d 100644 --- a/.github/workflows/composer-root-version.yaml +++ b/.github/workflows/composer-root-version.yaml @@ -4,10 +4,9 @@ on: push: branches: [ main ] pull_request: ~ - -schedule: - # Do not make it the first of the month and/or midnight since it is a very busy time - - cron: "* 10 5 * *" + schedule: + # Do not make it the first of the month and/or midnight since it is a very busy time + - cron: "* 10 5 * *" # See https://stackoverflow.com/a/72408109 concurrency: diff --git a/.github/workflows/e2e-tests.yaml b/.github/workflows/e2e-tests.yaml index 1e105a71..e2321693 100644 --- a/.github/workflows/e2e-tests.yaml +++ b/.github/workflows/e2e-tests.yaml @@ -6,10 +6,9 @@ on: pull_request: ~ release: types: [ created ] - -schedule: - # Do not make it the first of the month and/or midnight since it is a very busy time - - cron: "* 10 5 * *" + schedule: + # Do not make it the first of the month and/or midnight since it is a very busy time + - cron: "* 10 5 * *" # See https://stackoverflow.com/a/72408109 concurrency: diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index a6f2dff8..ab14c5e5 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -4,10 +4,9 @@ on: push: branches: [ main ] pull_request: ~ - -schedule: - # Do not make it the first of the month and/or midnight since it is a very busy time - - cron: "* 10 5 * *" + schedule: + # Do not make it the first of the month and/or midnight since it is a very busy time + - cron: "* 10 5 * *" # See https://stackoverflow.com/a/72408109 concurrency: diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 59a30db2..0116a795 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -6,10 +6,9 @@ on: pull_request: ~ release: types: [ created ] - -schedule: - # Do not make it the first of the month and/or midnight since it is a very busy time - - cron: "* 10 5 * *" + schedule: + # Do not make it the first of the month and/or midnight since it is a very busy time + - cron: "* 10 5 * *" # See https://stackoverflow.com/a/72408109 concurrency: diff --git a/.github/workflows/security.yaml b/.github/workflows/security.yaml index 3df94d75..7664b859 100644 --- a/.github/workflows/security.yaml +++ b/.github/workflows/security.yaml @@ -6,9 +6,9 @@ on: pull_request: ~ release: types: [ created ] -schedule: - # Do not make it the first of the month and/or midnight since it is a very busy time - - cron: "* 10 5 * *" + schedule: + # Do not make it the first of the month and/or midnight since it is a very busy time + - cron: "* 10 5 * *" # See https://stackoverflow.com/a/72408109 concurrency: diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 8a9af362..4fceb0d4 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -6,10 +6,9 @@ on: pull_request: ~ release: types: [ created ] ~ - -schedule: - # Do not make it the first of the month and/or midnight since it is a very busy time - - cron: "* 10 5 * *" + schedule: + # Do not make it the first of the month and/or midnight since it is a very busy time + - cron: "* 10 5 * *" # See https://stackoverflow.com/a/72408109 concurrency: