From 3b18f375805f659736daad6c1409f8d7fc1af316 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Wed, 30 Apr 2025 00:16:39 -0700 Subject: [PATCH 1/6] test.yml - Don't need as many intermediate versions --- .github/workflows/test.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 97a2562..3372d9b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,9 +15,6 @@ jobs: - operating-system: ubuntu-latest php: 7.3 phpunit: 8 - - operating-system: ubuntu-latest - php: 7.4 - phpunit: 8 - operating-system: ubuntu-latest php: 8.1 phpunit: 9 From 65a64c99f5411ab457f6a95ef51dfb505e0797c7 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Wed, 30 Apr 2025 00:17:07 -0700 Subject: [PATCH 2/6] test.yml - More consistent labels --- .github/workflows/test.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3372d9b..693c415 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,8 +33,7 @@ jobs: steps: - uses: actions/checkout@v3 - uses: php-actions/composer@v6 - - name: PHPUnit Tests - uses: php-actions/phpunit@v3 + - uses: php-actions/phpunit@v3 with: configuration: phpunit.xml.dist version: ${{ matrix.phpunit }} From 140cb8c05636f3d6cda1ea717a62fb3de02821e0 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Wed, 30 Apr 2025 00:24:24 -0700 Subject: [PATCH 3/6] Update symfony/console (4.4=>5.4) --- composer.json | 2 +- composer.lock | 293 +++++++++++++++++++++-- src/GitScan/Command/AutoMergeCommand.php | 4 +- src/GitScan/Command/BranchCommand.php | 8 +- src/GitScan/Command/DiffCommand.php | 3 +- src/GitScan/Command/ExportCommand.php | 5 +- src/GitScan/Command/ForeachCommand.php | 2 +- src/GitScan/Command/HashCommand.php | 5 +- src/GitScan/Command/LsCommand.php | 5 +- src/GitScan/Command/PushCommand.php | 3 +- src/GitScan/Command/StatusCommand.php | 3 +- src/GitScan/Command/TagCommand.php | 8 +- src/GitScan/Command/UpdateCommand.php | 2 +- 13 files changed, 306 insertions(+), 37 deletions(-) diff --git a/composer.json b/composer.json index e495c02..dc3235d 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,7 @@ ], "require": { "php": ">=7.3.0", - "symfony/console": "^4.4", + "symfony/console": "~5.4", "symfony/process": "^4.4", "symfony/filesystem": "^4.4", "symfony/finder": "^4.4", diff --git a/composer.lock b/composer.lock index b7b0a75..69785a7 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": "59bae10d7028af1914a2558243ed6135", + "content-hash": "dbe8036aca21501f75a9365e9d5bec0e", "packages": [ { "name": "civicrm/composer-downloads-plugin", @@ -106,43 +106,46 @@ }, { "name": "symfony/console", - "version": "v4.4.43", + "version": "v5.4.47", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "8a2628d2d5639f35113dc1b833ecd91e1ed1cf46" + "reference": "c4ba980ca61a9eb18ee6bcc73f28e475852bb1ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/8a2628d2d5639f35113dc1b833ecd91e1ed1cf46", - "reference": "8a2628d2d5639f35113dc1b833ecd91e1ed1cf46", + "url": "https://api.github.com/repos/symfony/console/zipball/c4ba980ca61a9eb18ee6bcc73f28e475852bb1ed", + "reference": "c4ba980ca61a9eb18ee6bcc73f28e475852bb1ed", "shasum": "" }, "require": { - "php": ">=7.1.3", + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php73": "^1.8", + "symfony/polyfill-php73": "^1.9", "symfony/polyfill-php80": "^1.16", - "symfony/service-contracts": "^1.1|^2" + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/string": "^5.1|^6.0" }, "conflict": { "psr/log": ">=3", - "symfony/dependency-injection": "<3.4", - "symfony/event-dispatcher": "<4.3|>=5", + "symfony/dependency-injection": "<4.4", + "symfony/dotenv": "<5.1", + "symfony/event-dispatcher": "<4.4", "symfony/lock": "<4.4", - "symfony/process": "<3.3" + "symfony/process": "<4.4" }, "provide": { "psr/log-implementation": "1.0|2.0" }, "require-dev": { "psr/log": "^1|^2", - "symfony/config": "^3.4|^4.0|^5.0", - "symfony/dependency-injection": "^3.4|^4.0|^5.0", - "symfony/event-dispatcher": "^4.3", - "symfony/lock": "^4.4|^5.0", - "symfony/process": "^3.4|^4.0|^5.0", - "symfony/var-dumper": "^4.3|^5.0" + "symfony/config": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^4.4|^5.0|^6.0", + "symfony/event-dispatcher": "^4.4|^5.0|^6.0", + "symfony/lock": "^4.4|^5.0|^6.0", + "symfony/process": "^4.4|^5.0|^6.0", + "symfony/var-dumper": "^4.4|^5.0|^6.0" }, "suggest": { "psr/log": "For using the console logger", @@ -175,6 +178,15 @@ ], "description": "Eases the creation of beautiful and testable command line interfaces", "homepage": "https://symfony.com", + "keywords": [ + "cli", + "command-line", + "console", + "terminal" + ], + "support": { + "source": "https://github.com/symfony/console/tree/v5.4.47" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -189,7 +201,7 @@ "type": "tidelift" } ], - "time": "2022-06-23T12:22:25+00:00" + "time": "2024-11-06T11:30:55+00:00" }, { "name": "symfony/deprecation-contracts", @@ -453,6 +465,165 @@ ], "time": "2022-05-24T11:49:31+00:00" }, + { + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.31.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe", + "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + } + }, + "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 for intl's grapheme_* functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "grapheme", + "intl", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.31.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": "2024-09-09T11:45:10+00:00" + }, + { + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.31.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "3833d7255cc303546435cb650316bff708a1c75c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/3833d7255cc303546435cb650316bff708a1c75c", + "reference": "3833d7255cc303546435cb650316bff708a1c75c", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "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 for intl's Normalizer class and related functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.31.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": "2024-09-09T11:45:10+00:00" + }, { "name": "symfony/polyfill-mbstring", "version": "v1.1.1", @@ -807,6 +978,92 @@ ], "time": "2022-05-30T19:17:29+00:00" }, + { + "name": "symfony/string", + "version": "v5.4.47", + "source": { + "type": "git", + "url": "https://github.com/symfony/string.git", + "reference": "136ca7d72f72b599f2631aca474a4f8e26719799" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/string/zipball/136ca7d72f72b599f2631aca474a4f8e26719799", + "reference": "136ca7d72f72b599f2631aca474a4f8e26719799", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-intl-grapheme": "~1.0", + "symfony/polyfill-intl-normalizer": "~1.0", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php80": "~1.15" + }, + "conflict": { + "symfony/translation-contracts": ">=3.0" + }, + "require-dev": { + "symfony/error-handler": "^4.4|^5.0|^6.0", + "symfony/http-client": "^4.4|^5.0|^6.0", + "symfony/translation-contracts": "^1.1|^2", + "symfony/var-exporter": "^4.4|^5.0|^6.0" + }, + "type": "library", + "autoload": { + "files": [ + "Resources/functions.php" + ], + "psr-4": { + "Symfony\\Component\\String\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "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": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", + "homepage": "https://symfony.com", + "keywords": [ + "grapheme", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" + ], + "support": { + "source": "https://github.com/symfony/string/tree/v5.4.47" + }, + "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": "2024-11-10T20:33:58+00:00" + }, { "name": "togos/gitignore", "version": "1.1.1", diff --git a/src/GitScan/Command/AutoMergeCommand.php b/src/GitScan/Command/AutoMergeCommand.php index 71fabaa..4a9e5db 100644 --- a/src/GitScan/Command/AutoMergeCommand.php +++ b/src/GitScan/Command/AutoMergeCommand.php @@ -70,7 +70,7 @@ protected function initialize(InputInterface $input, OutputInterface $output) { $this->fs->validateExists($input->getOption('path')); } - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): int { $registeredSources = json_decode(file_get_contents(dirname(__DIR__) . '/AutoMergeRule.json'), 1); $rules = array(); foreach ($this->getPatchExprs($input, $output) as $expr) { @@ -122,6 +122,8 @@ protected function execute(InputInterface $input, OutputInterface $output) { if (!empty($rules)) { return 1; } + + return 0; } /** diff --git a/src/GitScan/Command/BranchCommand.php b/src/GitScan/Command/BranchCommand.php index afb5e4d..f7486eb 100644 --- a/src/GitScan/Command/BranchCommand.php +++ b/src/GitScan/Command/BranchCommand.php @@ -44,7 +44,7 @@ protected function initialize(InputInterface $input, OutputInterface $output) { $this->fs->validateExists($input->getOption('path')); } - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): int { if ($input->getOption('delete') || $input->getOption('force-delete')) { return $this->executeDelete($input, $output); } @@ -53,7 +53,7 @@ protected function execute(InputInterface $input, OutputInterface $output) { } } - protected function executeCreate(InputInterface $input, OutputInterface $output) { + protected function executeCreate(InputInterface $input, OutputInterface $output): int { if (!$input->getArgument('head')) { throw new \RuntimeException("Missing argument \"head\". Please specify the name of original base branch."); } @@ -97,9 +97,10 @@ function (GitRepo $gitRepo, $oldBranch, $newBranch) use ($input, $output, $helpe }); $batch->runAllOk($output, $input->getOption('dry-run')); + return 0; } - protected function executeDelete(InputInterface $input, OutputInterface $output) { + protected function executeDelete(InputInterface $input, OutputInterface $output): int { $helper = $this->getHelper('question'); $scanner = new \GitScan\GitRepoScanner(); $gitRepos = $scanner->scan($input->getOption('path')); @@ -131,6 +132,7 @@ protected function executeDelete(InputInterface $input, OutputInterface $output) } $batch->runAllOk($output, $input->getOption('dry-run')); + return 0; } } diff --git a/src/GitScan/Command/DiffCommand.php b/src/GitScan/Command/DiffCommand.php index 249a97b..6546238 100644 --- a/src/GitScan/Command/DiffCommand.php +++ b/src/GitScan/Command/DiffCommand.php @@ -45,7 +45,7 @@ protected function initialize(InputInterface $input, OutputInterface $output) { $this->fs->validateExists($input->getArgument('to')); } - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): int { $fromDoc = $this->getCheckoutDocument($input->getArgument('from')); $toDoc = $this->getCheckoutDocument($input->getArgument('to')); @@ -82,6 +82,7 @@ protected function execute(InputInterface $input, OutputInterface $output) { $output->writeln('Unsupported output format'); return 1; } + return 0; } /** diff --git a/src/GitScan/Command/ExportCommand.php b/src/GitScan/Command/ExportCommand.php index 0c77f42..244a339 100644 --- a/src/GitScan/Command/ExportCommand.php +++ b/src/GitScan/Command/ExportCommand.php @@ -34,12 +34,12 @@ protected function initialize(InputInterface $input, OutputInterface $output) { $this->fs->validateExists($input->getArgument('path')); } - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): int { $scanner = new \GitScan\GitRepoScanner(); $paths = $input->getArgument('path'); if (count($paths) != 1) { $output->writeln('Expected only one root path'); - return; + return 1; } $gitRepos = $scanner->scan($paths); @@ -48,6 +48,7 @@ protected function execute(InputInterface $input, OutputInterface $output) { ->importRepos($gitRepos) ->toJson() ); + return 0; } } diff --git a/src/GitScan/Command/ForeachCommand.php b/src/GitScan/Command/ForeachCommand.php index ccf565a..954ffd2 100644 --- a/src/GitScan/Command/ForeachCommand.php +++ b/src/GitScan/Command/ForeachCommand.php @@ -58,7 +58,7 @@ protected function initialize(InputInterface $input, OutputInterface $output) { $this->fs->validateExists($input->getArgument('path')); } - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): int { if (!$input->getOption('command')) { $output->writeln("Missing required option: --command"); return 1; diff --git a/src/GitScan/Command/HashCommand.php b/src/GitScan/Command/HashCommand.php index d2f2142..a978354 100644 --- a/src/GitScan/Command/HashCommand.php +++ b/src/GitScan/Command/HashCommand.php @@ -34,15 +34,16 @@ protected function initialize(InputInterface $input, OutputInterface $output) { $this->fs->validateExists($input->getArgument('path')); } - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): int { $scanner = new \GitScan\GitRepoScanner(); $paths = $input->getArgument('path'); if (count($paths) != 1) { $output->writeln('Expected only one root path'); - return; + return 1; } $output->writeln($scanner->hash($paths[0])); + return 0; } } diff --git a/src/GitScan/Command/LsCommand.php b/src/GitScan/Command/LsCommand.php index 44b6d84..bd9d549 100644 --- a/src/GitScan/Command/LsCommand.php +++ b/src/GitScan/Command/LsCommand.php @@ -39,12 +39,12 @@ protected function initialize(InputInterface $input, OutputInterface $output) { $this->fs->validateExists($input->getArgument('path')); } - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): int { $scanner = new \GitScan\GitRepoScanner(); $paths = $input->getArgument('path'); if (count($paths) != 1) { $output->writeln('Expected only one root path'); - return; + return 1; } $gitRepos = $scanner->scan($paths); @@ -56,6 +56,7 @@ protected function execute(InputInterface $input, OutputInterface $output) { $path = rtrim($path, '/'); $output->writeln($path); } + return 0; } } diff --git a/src/GitScan/Command/PushCommand.php b/src/GitScan/Command/PushCommand.php index da30583..0a987c6 100644 --- a/src/GitScan/Command/PushCommand.php +++ b/src/GitScan/Command/PushCommand.php @@ -40,7 +40,7 @@ protected function initialize(InputInterface $input, OutputInterface $output) { $this->fs->validateExists($input->getOption('path')); } - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): int { $scanner = new \GitScan\GitRepoScanner(); $gitRepos = $scanner->scan($input->getOption('path')); $remote = $input->getArgument('remote'); @@ -80,6 +80,7 @@ protected function execute(InputInterface $input, OutputInterface $output) { } $batch->runAllOk($output, $input->getOption('dry-run')); + return 0; } } diff --git a/src/GitScan/Command/StatusCommand.php b/src/GitScan/Command/StatusCommand.php index e18a741..d0ca61d 100644 --- a/src/GitScan/Command/StatusCommand.php +++ b/src/GitScan/Command/StatusCommand.php @@ -45,7 +45,7 @@ protected function initialize(InputInterface $input, OutputInterface $output) { $this->fs->validateExists($input->getArgument('path')); } - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): int { $output->writeln("[[ Finding repositories ]]"); $scanner = new \GitScan\GitRepoScanner(); $gitRepos = $scanner->scan($input->getArgument('path')); @@ -143,6 +143,7 @@ protected function execute(InputInterface $input, OutputInterface $output) { $output->writeln("NOTE: Omitted information about $hiddenCount repo(s). To display all, use --status=all."); } } + return 0; } public function getUniqueChars($items) { diff --git a/src/GitScan/Command/TagCommand.php b/src/GitScan/Command/TagCommand.php index becdd81..1cc942a 100644 --- a/src/GitScan/Command/TagCommand.php +++ b/src/GitScan/Command/TagCommand.php @@ -43,7 +43,7 @@ protected function initialize(InputInterface $input, OutputInterface $output) { $this->fs->validateExists($input->getOption('path')); } - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): int { if ($input->getOption('delete')) { return $this->executeDelete($input, $output); } @@ -52,7 +52,7 @@ protected function execute(InputInterface $input, OutputInterface $output) { } } - protected function executeCreate(InputInterface $input, OutputInterface $output) { + protected function executeCreate(InputInterface $input, OutputInterface $output): int { if (!$input->getArgument('head')) { throw new \RuntimeException("Missing argument \"head\". Please specify the name of original base branch."); } @@ -96,9 +96,10 @@ function (GitRepo $gitRepo, $oldBranch, $newTag) use ($input, $output, $helper, }); $batch->runAllOk($output, $input->getOption('dry-run')); + return 0; } - protected function executeDelete(InputInterface $input, OutputInterface $output) { + protected function executeDelete(InputInterface $input, OutputInterface $output): int { $scanner = new \GitScan\GitRepoScanner(); $gitRepos = $scanner->scan($input->getOption('path')); $batch = new ProcessBatch('Deleting branch(es)...'); @@ -128,6 +129,7 @@ protected function executeDelete(InputInterface $input, OutputInterface $output) } $batch->runAllOk($output, $input->getOption('dry-run')); + return 0; } } diff --git a/src/GitScan/Command/UpdateCommand.php b/src/GitScan/Command/UpdateCommand.php index bb4a59e..3a6a5d1 100644 --- a/src/GitScan/Command/UpdateCommand.php +++ b/src/GitScan/Command/UpdateCommand.php @@ -35,7 +35,7 @@ protected function initialize(InputInterface $input, OutputInterface $output) { $this->fs->validateExists($input->getArgument('path')); } - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): int { $statusCode = 0; $output->writeln("[[ Finding repositories ]]"); From da888f6b8190cf5e7dccb3d06048e3214a99fa7a Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Wed, 30 Apr 2025 00:29:08 -0700 Subject: [PATCH 4/6] gitignore - /dist and /tmp --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 8256bc1..8323baa 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,5 @@ /bin/git-scan.phar /bin/phpunit /extern +/dist +/tmp From 8ad70b22abc571ca5399571d0c2550ebbb9ac6c1 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Wed, 30 Apr 2025 00:36:14 -0700 Subject: [PATCH 5/6] Update symfony/process (4.4=>5.4) --- composer.json | 2 +- composer.lock | 17 ++++++++++------- src/GitScan/Command/ForeachCommand.php | 2 +- src/GitScan/Exception/ProcessErrorException.php | 2 +- src/GitScan/GitRepo.php | 2 +- src/GitScan/GitRepoScanner.php | 2 +- tests/GitScan/GitScanTestCase.php | 2 +- tests/GitScan/Util/ProcessTest.php | 4 ++-- 8 files changed, 18 insertions(+), 15 deletions(-) diff --git a/composer.json b/composer.json index dc3235d..c000093 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ "require": { "php": ">=7.3.0", "symfony/console": "~5.4", - "symfony/process": "^4.4", + "symfony/process": "~5.4", "symfony/filesystem": "^4.4", "symfony/finder": "^4.4", "civicrm/composer-downloads-plugin": "~3.0" diff --git a/composer.lock b/composer.lock index 69785a7..669761d 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": "dbe8036aca21501f75a9365e9d5bec0e", + "content-hash": "cd21cb15a2eebceb37528fed8057ad8c", "packages": [ { "name": "civicrm/composer-downloads-plugin", @@ -841,20 +841,20 @@ }, { "name": "symfony/process", - "version": "v4.4.41", + "version": "v5.4.47", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "9eedd60225506d56e42210a70c21bb80ca8456ce" + "reference": "5d1662fb32ebc94f17ddb8d635454a776066733d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/9eedd60225506d56e42210a70c21bb80ca8456ce", - "reference": "9eedd60225506d56e42210a70c21bb80ca8456ce", + "url": "https://api.github.com/repos/symfony/process/zipball/5d1662fb32ebc94f17ddb8d635454a776066733d", + "reference": "5d1662fb32ebc94f17ddb8d635454a776066733d", "shasum": "" }, "require": { - "php": ">=7.1.3", + "php": ">=7.2.5", "symfony/polyfill-php80": "^1.16" }, "type": "library", @@ -882,6 +882,9 @@ ], "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/process/tree/v5.4.47" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -896,7 +899,7 @@ "type": "tidelift" } ], - "time": "2022-04-04T10:19:07+00:00" + "time": "2024-11-06T11:36:42+00:00" }, { "name": "symfony/service-contracts", diff --git a/src/GitScan/Command/ForeachCommand.php b/src/GitScan/Command/ForeachCommand.php index 954ffd2..8ee1809 100644 --- a/src/GitScan/Command/ForeachCommand.php +++ b/src/GitScan/Command/ForeachCommand.php @@ -83,7 +83,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int if (OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) { $output->writeln("[[ {$gitRepo->getPath()} ]]"); } - $process = new \Symfony\Component\Process\Process($input->getOption('command')); + $process = \Symfony\Component\Process\Process::fromShellCommandline($input->getOption('command')); $process->setWorkingDirectory($gitRepo->getPath()); // $process->setEnv(...); sucks in Debian/Ubuntu Env::set('path', $this->fs->makePathRelative($gitRepo->getPath(), $topLevel)); diff --git a/src/GitScan/Exception/ProcessErrorException.php b/src/GitScan/Exception/ProcessErrorException.php index 9c0366d..e7828d5 100644 --- a/src/GitScan/Exception/ProcessErrorException.php +++ b/src/GitScan/Exception/ProcessErrorException.php @@ -7,7 +7,7 @@ class ProcessErrorException extends \RuntimeException { */ private $process; - public function __construct(\Symfony\Component\Process\Process $process, $message = "", $code = 0, Exception $previous = NULL) { + public function __construct(\Symfony\Component\Process\Process $process, $message = "", $code = 0, ?\Throwable $previous = NULL) { $this->process = $process; if (empty($message)) { $message = $this->createReport($process); diff --git a/src/GitScan/GitRepo.php b/src/GitScan/GitRepo.php index c24b3a2..208d889 100644 --- a/src/GitScan/GitRepo.php +++ b/src/GitScan/GitRepo.php @@ -499,7 +499,7 @@ public function initClone($upstream, ?string $branch = NULL): void { * @return \Symfony\Component\Process\Process */ public function command($command) { - $process = new \Symfony\Component\Process\Process($command); + $process = \Symfony\Component\Process\Process::fromShellCommandline($command); $process->setWorkingDirectory($this->getPath()); return $process; } diff --git a/src/GitScan/GitRepoScanner.php b/src/GitScan/GitRepoScanner.php index dd5521b..5e48dbf 100644 --- a/src/GitScan/GitRepoScanner.php +++ b/src/GitScan/GitRepoScanner.php @@ -20,7 +20,7 @@ class GitRepoScanner { * @param FileSystem $fs * @param \GitScan\Config|NULL $config */ - public function __construct($fs = NULL, \GitScan\Config $config = NULL) { + public function __construct($fs = NULL, ?\GitScan\Config $config = NULL) { $this->fs = $fs ?: new Filesystem(); $this->config = $config ?: Config::load(); } diff --git a/tests/GitScan/GitScanTestCase.php b/tests/GitScan/GitScanTestCase.php index 64ca63f..d4377a1 100644 --- a/tests/GitScan/GitScanTestCase.php +++ b/tests/GitScan/GitScanTestCase.php @@ -51,7 +51,7 @@ public function tearDown(): void { * @param string $command */ protected function command($subdir, $command) { - $process = new \Symfony\Component\Process\Process($command); + $process = \Symfony\Component\Process\Process::fromShellCommandline($command); if ($subdir !== NULL && $subdir !== "") { $process->setWorkingDirectory($subdir); } diff --git a/tests/GitScan/Util/ProcessTest.php b/tests/GitScan/Util/ProcessTest.php index 09858d4..dd51346 100644 --- a/tests/GitScan/Util/ProcessTest.php +++ b/tests/GitScan/Util/ProcessTest.php @@ -6,13 +6,13 @@ class ProcessTest extends \GitScan\GitScanTestCase { public function testRunOk_pass() { - $process = ProcessUtil::runOk(new \Symfony\Component\Process\Process("echo times were good")); + $process = ProcessUtil::runOk(\Symfony\Component\Process\Process::fromShellCommandline("echo times were good")); $this->assertEquals("times were good", trim($process->getOutput())); } public function testRunOk_fail() { try { - ProcessUtil::runOk(new \Symfony\Component\Process\Process("echo tragedy befell the software > /dev/stderr; exit 1")); + ProcessUtil::runOk(\Symfony\Component\Process\Process::fromShellCommandline("echo tragedy befell the software > /dev/stderr; exit 1")); $this->fail("Failed to generate expected exception"); } catch (\GitScan\Exception\ProcessErrorException $e) { From 525d558cb7820ecc77d5bd8a464c91ddaafe9a3c Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Wed, 30 Apr 2025 00:38:18 -0700 Subject: [PATCH 6/6] Update symfony/filesystem (4.4=>5.4) --- composer.json | 2 +- composer.lock | 110 +++++++++++++++++++++++++++++++------------------- 2 files changed, 70 insertions(+), 42 deletions(-) diff --git a/composer.json b/composer.json index c000093..abc23a6 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ "php": ">=7.3.0", "symfony/console": "~5.4", "symfony/process": "~5.4", - "symfony/filesystem": "^4.4", + "symfony/filesystem": "~5.4", "symfony/finder": "^4.4", "civicrm/composer-downloads-plugin": "~3.0" }, diff --git a/composer.lock b/composer.lock index 669761d..c89acac 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": "cd21cb15a2eebceb37528fed8057ad8c", + "content-hash": "c42314448bb7b0a90262853b464891ee", "packages": [ { "name": "civicrm/composer-downloads-plugin", @@ -269,23 +269,27 @@ }, { "name": "symfony/filesystem", - "version": "v4.4.42", + "version": "v5.4.45", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "815412ee8971209bd4c1eecd5f4f481eacd44bf5" + "reference": "57c8294ed37d4a055b77057827c67f9558c95c54" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/815412ee8971209bd4c1eecd5f4f481eacd44bf5", - "reference": "815412ee8971209bd4c1eecd5f4f481eacd44bf5", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/57c8294ed37d4a055b77057827c67f9558c95c54", + "reference": "57c8294ed37d4a055b77057827c67f9558c95c54", "shasum": "" }, "require": { - "php": ">=7.1.3", + "php": ">=7.2.5", "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.8", "symfony/polyfill-php80": "^1.16" }, + "require-dev": { + "symfony/process": "^5.4|^6.4" + }, "type": "library", "autoload": { "psr-4": { @@ -311,6 +315,9 @@ ], "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/filesystem/tree/v5.4.45" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -325,7 +332,7 @@ "type": "tidelift" } ], - "time": "2022-05-20T08:49:14+00:00" + "time": "2024-10-22T13:05:35+00:00" }, { "name": "symfony/finder", @@ -388,20 +395,20 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.26.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4" + "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638" }, "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/a3cc8b044a6ea513310cbd48ef7333b384945638", + "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "provide": { "ext-ctype": "*" @@ -411,12 +418,9 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.26-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -449,6 +453,9 @@ "polyfill", "portable" ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.31.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -463,7 +470,7 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-intl-grapheme", @@ -626,37 +633,41 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.1.1", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "1289d16209491b584839022f29257ad859b8532d" + "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/1289d16209491b584839022f29257ad859b8532d", - "reference": "1289d16209491b584839022f29257ad859b8532d", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/85181ba99b2345b0ef10ce42ecac37612d9fd341", + "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.2" + }, + "provide": { + "ext-mbstring": "*" }, "suggest": { "ext-mbstring": "For best performance" }, "type": "library", "extra": { - "branch-alias": { - "dev-master": "1.1-dev" + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - }, "files": [ "bootstrap.php" - ] + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -681,7 +692,24 @@ "portable", "shim" ], - "time": "2016-01-20T09:13:37+00:00" + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.31.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": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-php73", @@ -761,29 +789,26 @@ }, { "name": "symfony/polyfill-php80", - "version": "v1.26.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace" + "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8" }, "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/60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", + "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.26-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -823,6 +848,9 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.31.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -837,7 +865,7 @@ "type": "tidelift" } ], - "time": "2022-05-10T07:21:04+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/process",