From 3d307d74ba0d50733cae60cb7756d85c160916a4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 5 Feb 2025 18:47:10 +0000 Subject: [PATCH] Build(deps-dev): Bump friendsofphp/php-cs-fixer from 3.59.3 to 3.68.5 (#2893) * Build(deps-dev): Bump friendsofphp/php-cs-fixer from 3.59.3 to 3.68.5 Bumps [friendsofphp/php-cs-fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer) from 3.59.3 to 3.68.5. - [Release notes](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/releases) - [Changelog](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/master/CHANGELOG.md) - [Commits](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/compare/v3.59.3...v3.68.5) --- updated-dependencies: - dependency-name: friendsofphp/php-cs-fixer dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Fix cs --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Vincent Langlet --- composer.lock | 136 +++++++++--------- src/Action/DetermineNextRelease.php | 2 +- src/Action/DetermineNextReleaseVersion.php | 2 +- .../NoPullRequestsMergedSinceLastRelease.php | 2 +- src/Command/AutoMergeCommand.php | 12 +- ...CommentNonMergeablePullRequestsCommand.php | 10 +- src/Command/DependsCommand.php | 4 +- .../DispatchBranchesProtectionCommand.php | 22 +-- .../Dispatcher/DispatchFilesCommand.php | 32 ++--- .../Dispatcher/DispatchHooksCommand.php | 16 +-- .../Dispatcher/DispatchLabelsCommand.php | 4 +- .../Dispatcher/DispatchSettingsCommand.php | 4 +- .../Dispatcher/DispatchTopicsCommand.php | 8 +- src/Command/ReleaseCommand.php | 28 ++-- src/Config/ConfiguredLabels.php | 2 +- src/Config/Exception/UnknownBranch.php | 2 +- src/Config/Exception/UnknownProject.php | 2 +- src/Config/Projects.php | 2 +- src/Controller/GithubController.php | 2 +- .../Exception/CannotGenerateChangelog.php | 2 +- src/Domain/Exception/NoBranchesAvailable.php | 2 +- src/Domain/Value/Branch.php | 2 +- src/Domain/Value/Changelog.php | 2 +- src/Domain/Value/Changelog/Section.php | 2 +- src/Domain/Value/NextRelease.php | 4 +- src/Domain/Value/Project.php | 2 +- src/Domain/Value/Variant.php | 2 +- src/Git/GitManipulator.php | 12 +- src/Github/Domain/Value/CheckRun.php | 6 +- src/Github/Domain/Value/CombinedStatus.php | 2 +- src/Github/Domain/Value/PullRequest.php | 4 +- src/Github/Domain/Value/Repository.php | 2 +- src/Github/Domain/Value/Search/Query.php | 4 +- src/Github/Domain/Value/Status.php | 6 +- src/Github/Domain/Value/User.php | 2 +- .../Exception/LatestReleaseNotFound.php | 4 +- src/Github/HookProcessor.php | 14 +- src/Twig/Extension/FileSystemExtension.php | 2 +- ...oPullRequestMergedSinceLastReleaseTest.php | 2 +- tests/Config/Exception/UnknownBranchTest.php | 2 +- tests/Config/Exception/UnknownProjectTest.php | 2 +- .../Exception/NoBranchesAvaillableTest.php | 2 +- tests/Github/Domain/Value/Issue/IssueTest.php | 2 +- tests/Github/Domain/Value/Label/ColorTest.php | 3 +- tests/Github/Domain/Value/PullRequestTest.php | 2 +- .../Exception/LatestReleaseNotFoundTest.php | 2 +- .../Github/Response/PullRequestFactory.php | 2 +- 47 files changed, 191 insertions(+), 196 deletions(-) diff --git a/composer.lock b/composer.lock index 1cfe97255..39fc94123 100644 --- a/composer.lock +++ b/composer.lock @@ -2120,16 +2120,16 @@ }, { "name": "symfony/console", - "version": "v6.4.15", + "version": "v6.4.17", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "f1fc6f47283e27336e7cebb9e8946c8de7bff9bd" + "reference": "799445db3f15768ecc382ac5699e6da0520a0a04" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/f1fc6f47283e27336e7cebb9e8946c8de7bff9bd", - "reference": "f1fc6f47283e27336e7cebb9e8946c8de7bff9bd", + "url": "https://api.github.com/repos/symfony/console/zipball/799445db3f15768ecc382ac5699e6da0520a0a04", + "reference": "799445db3f15768ecc382ac5699e6da0520a0a04", "shasum": "" }, "require": { @@ -2194,7 +2194,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.4.15" + "source": "https://github.com/symfony/console/tree/v6.4.17" }, "funding": [ { @@ -2210,7 +2210,7 @@ "type": "tidelift" } ], - "time": "2024-11-06T14:19:14+00:00" + "time": "2024-12-07T12:07:30+00:00" }, { "name": "symfony/dependency-injection", @@ -3614,16 +3614,16 @@ }, { "name": "symfony/options-resolver", - "version": "v6.4.13", + "version": "v6.4.16", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "0a62a9f2504a8dd27083f89d21894ceb01cc59db" + "reference": "368128ad168f20e22c32159b9f761e456cec0c78" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/0a62a9f2504a8dd27083f89d21894ceb01cc59db", - "reference": "0a62a9f2504a8dd27083f89d21894ceb01cc59db", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/368128ad168f20e22c32159b9f761e456cec0c78", + "reference": "368128ad168f20e22c32159b9f761e456cec0c78", "shasum": "" }, "require": { @@ -3661,7 +3661,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v6.4.13" + "source": "https://github.com/symfony/options-resolver/tree/v6.4.16" }, "funding": [ { @@ -3677,7 +3677,7 @@ "type": "tidelift" } ], - "time": "2024-09-25T14:18:03+00:00" + "time": "2024-11-20T10:57:02+00:00" }, { "name": "symfony/polyfill-intl-grapheme", @@ -6415,16 +6415,16 @@ }, { "name": "friendsofphp/php-cs-fixer", - "version": "v3.59.3", + "version": "v3.68.5", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", - "reference": "30ba9ecc2b0e5205e578fe29973c15653d9bfd29" + "reference": "7bedb718b633355272428c60736dc97fb96daf27" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/30ba9ecc2b0e5205e578fe29973c15653d9bfd29", - "reference": "30ba9ecc2b0e5205e578fe29973c15653d9bfd29", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/7bedb718b633355272428c60736dc97fb96daf27", + "reference": "7bedb718b633355272428c60736dc97fb96daf27", "shasum": "" }, "require": { @@ -6434,38 +6434,38 @@ "ext-filter": "*", "ext-json": "*", "ext-tokenizer": "*", - "fidry/cpu-core-counter": "^1.0", + "fidry/cpu-core-counter": "^1.2", "php": "^7.4 || ^8.0", "react/child-process": "^0.6.5", "react/event-loop": "^1.0", "react/promise": "^2.0 || ^3.0", "react/socket": "^1.0", "react/stream": "^1.0", - "sebastian/diff": "^4.0 || ^5.0 || ^6.0", - "symfony/console": "^5.4 || ^6.0 || ^7.0", - "symfony/event-dispatcher": "^5.4 || ^6.0 || ^7.0", - "symfony/filesystem": "^5.4 || ^6.0 || ^7.0", - "symfony/finder": "^5.4 || ^6.0 || ^7.0", - "symfony/options-resolver": "^5.4 || ^6.0 || ^7.0", - "symfony/polyfill-mbstring": "^1.28", - "symfony/polyfill-php80": "^1.28", - "symfony/polyfill-php81": "^1.28", - "symfony/process": "^5.4 || ^6.0 || ^7.0", - "symfony/stopwatch": "^5.4 || ^6.0 || ^7.0" + "sebastian/diff": "^4.0 || ^5.1 || ^6.0", + "symfony/console": "^5.4 || ^6.4 || ^7.0", + "symfony/event-dispatcher": "^5.4 || ^6.4 || ^7.0", + "symfony/filesystem": "^5.4 || ^6.4 || ^7.0", + "symfony/finder": "^5.4 || ^6.4 || ^7.0", + "symfony/options-resolver": "^5.4 || ^6.4 || ^7.0", + "symfony/polyfill-mbstring": "^1.31", + "symfony/polyfill-php80": "^1.31", + "symfony/polyfill-php81": "^1.31", + "symfony/process": "^5.4 || ^6.4 || ^7.2", + "symfony/stopwatch": "^5.4 || ^6.4 || ^7.0" }, "require-dev": { - "facile-it/paraunit": "^1.3 || ^2.3", - "infection/infection": "^0.29.5", - "justinrainbow/json-schema": "^5.2", + "facile-it/paraunit": "^1.3.1 || ^2.4", + "infection/infection": "^0.29.8", + "justinrainbow/json-schema": "^5.3 || ^6.0", "keradus/cli-executor": "^2.1", - "mikey179/vfsstream": "^1.6.11", + "mikey179/vfsstream": "^1.6.12", "php-coveralls/php-coveralls": "^2.7", "php-cs-fixer/accessible-object": "^1.1", "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.5", "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.5", - "phpunit/phpunit": "^9.6.19 || ^10.5.21 || ^11.2", - "symfony/var-dumper": "^5.4 || ^6.0 || ^7.0", - "symfony/yaml": "^5.4 || ^6.0 || ^7.0" + "phpunit/phpunit": "^9.6.22 || ^10.5.40 || ^11.5.2", + "symfony/var-dumper": "^5.4.48 || ^6.4.15 || ^7.2.0", + "symfony/yaml": "^5.4.45 || ^6.4.13 || ^7.2.0" }, "suggest": { "ext-dom": "For handling output formats in XML", @@ -6506,7 +6506,7 @@ ], "support": { "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", - "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.59.3" + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.68.5" }, "funding": [ { @@ -6514,7 +6514,7 @@ "type": "github" } ], - "time": "2024-06-16T14:17:03+00:00" + "time": "2025-01-30T17:00:50+00:00" }, { "name": "myclabs/deep-copy", @@ -7974,33 +7974,33 @@ }, { "name": "react/child-process", - "version": "v0.6.5", + "version": "v0.6.6", "source": { "type": "git", "url": "https://github.com/reactphp/child-process.git", - "reference": "e71eb1aa55f057c7a4a0d08d06b0b0a484bead43" + "reference": "1721e2b93d89b745664353b9cfc8f155ba8a6159" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/child-process/zipball/e71eb1aa55f057c7a4a0d08d06b0b0a484bead43", - "reference": "e71eb1aa55f057c7a4a0d08d06b0b0a484bead43", + "url": "https://api.github.com/repos/reactphp/child-process/zipball/1721e2b93d89b745664353b9cfc8f155ba8a6159", + "reference": "1721e2b93d89b745664353b9cfc8f155ba8a6159", "shasum": "" }, "require": { "evenement/evenement": "^3.0 || ^2.0 || ^1.0", "php": ">=5.3.0", "react/event-loop": "^1.2", - "react/stream": "^1.2" + "react/stream": "^1.4" }, "require-dev": { - "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35", - "react/socket": "^1.8", + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "react/socket": "^1.16", "sebastian/environment": "^5.0 || ^3.0 || ^2.0 || ^1.0" }, "type": "library", "autoload": { "psr-4": { - "React\\ChildProcess\\": "src" + "React\\ChildProcess\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -8037,19 +8037,15 @@ ], "support": { "issues": "https://github.com/reactphp/child-process/issues", - "source": "https://github.com/reactphp/child-process/tree/v0.6.5" + "source": "https://github.com/reactphp/child-process/tree/v0.6.6" }, "funding": [ { - "url": "https://github.com/WyriHaximus", - "type": "github" - }, - { - "url": "https://github.com/clue", - "type": "github" + "url": "https://opencollective.com/reactphp", + "type": "open_collective" } ], - "time": "2022-09-16T13:41:56+00:00" + "time": "2025-01-01T16:37:48+00:00" }, { "name": "react/dns", @@ -8274,31 +8270,31 @@ }, { "name": "react/socket", - "version": "v1.15.0", + "version": "v1.16.0", "source": { "type": "git", "url": "https://github.com/reactphp/socket.git", - "reference": "216d3aec0b87f04a40ca04f481e6af01bdd1d038" + "reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/socket/zipball/216d3aec0b87f04a40ca04f481e6af01bdd1d038", - "reference": "216d3aec0b87f04a40ca04f481e6af01bdd1d038", + "url": "https://api.github.com/repos/reactphp/socket/zipball/23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1", + "reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1", "shasum": "" }, "require": { "evenement/evenement": "^3.0 || ^2.0 || ^1.0", "php": ">=5.3.0", - "react/dns": "^1.11", + "react/dns": "^1.13", "react/event-loop": "^1.2", - "react/promise": "^3 || ^2.6 || ^1.2.1", - "react/stream": "^1.2" + "react/promise": "^3.2 || ^2.6 || ^1.2.1", + "react/stream": "^1.4" }, "require-dev": { "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", - "react/async": "^4 || ^3 || ^2", + "react/async": "^4.3 || ^3.3 || ^2", "react/promise-stream": "^1.4", - "react/promise-timer": "^1.10" + "react/promise-timer": "^1.11" }, "type": "library", "autoload": { @@ -8342,7 +8338,7 @@ ], "support": { "issues": "https://github.com/reactphp/socket/issues", - "source": "https://github.com/reactphp/socket/tree/v1.15.0" + "source": "https://github.com/reactphp/socket/tree/v1.16.0" }, "funding": [ { @@ -8350,7 +8346,7 @@ "type": "open_collective" } ], - "time": "2023-12-15T11:02:10+00:00" + "time": "2024-07-26T10:38:09+00:00" }, { "name": "react/stream", @@ -9678,16 +9674,16 @@ }, { "name": "symfony/stopwatch", - "version": "v6.4.8", + "version": "v6.4.13", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "63e069eb616049632cde9674c46957819454b8aa" + "reference": "2cae0a6f8d04937d02f6d19806251e2104d54f92" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/63e069eb616049632cde9674c46957819454b8aa", - "reference": "63e069eb616049632cde9674c46957819454b8aa", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/2cae0a6f8d04937d02f6d19806251e2104d54f92", + "reference": "2cae0a6f8d04937d02f6d19806251e2104d54f92", "shasum": "" }, "require": { @@ -9720,7 +9716,7 @@ "description": "Provides a way to profile code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/stopwatch/tree/v6.4.8" + "source": "https://github.com/symfony/stopwatch/tree/v6.4.13" }, "funding": [ { @@ -9736,7 +9732,7 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:49:08+00:00" + "time": "2024-09-25T14:18:03+00:00" }, { "name": "symfony/web-profiler-bundle", diff --git a/src/Action/DetermineNextRelease.php b/src/Action/DetermineNextRelease.php index 0ddcc0aa4..0139fa726 100644 --- a/src/Action/DetermineNextRelease.php +++ b/src/Action/DetermineNextRelease.php @@ -40,7 +40,7 @@ public function __construct( Branches $branches, Statuses $statuses, Checks $checks, - PullRequests $pullRequests + PullRequests $pullRequests, ) { $this->releases = $releases; $this->branches = $branches; diff --git a/src/Action/DetermineNextReleaseVersion.php b/src/Action/DetermineNextReleaseVersion.php index 8cf966de8..73eff9cbf 100644 --- a/src/Action/DetermineNextReleaseVersion.php +++ b/src/Action/DetermineNextReleaseVersion.php @@ -39,7 +39,7 @@ public static function forTagAndPullRequests(Tag $current, array $pullRequests): if (isset($parts[3])) { if (str_contains($parts[3], 'alpha')) { - return Tag::fromString(implode('.', [$parts[0], $parts[1], sprintf('%s-rc-1', $parts[2])])); + return Tag::fromString(implode('.', [$parts[0], $parts[1], \sprintf('%s-rc-1', $parts[2])])); } return Tag::fromString(implode('.', [$parts[0], $parts[1], $parts[2]])); diff --git a/src/Action/Exception/NoPullRequestsMergedSinceLastRelease.php b/src/Action/Exception/NoPullRequestsMergedSinceLastRelease.php index 6708ac5ed..512c19027 100644 --- a/src/Action/Exception/NoPullRequestsMergedSinceLastRelease.php +++ b/src/Action/Exception/NoPullRequestsMergedSinceLastRelease.php @@ -26,7 +26,7 @@ public static function forBranch(Project $project, Branch $branch, ?\DateTimeImm $since = null !== $lastRelease ? $lastRelease->format('Y-m-d H:i:s') : 'never'; return new self( - sprintf( + \sprintf( 'No pull requests merged since last release "%s" for branch "%s" of project "%s".', $since, $branch->name(), diff --git a/src/Command/AutoMergeCommand.php b/src/Command/AutoMergeCommand.php index 8ad3a4ecd..63e092a13 100644 --- a/src/Command/AutoMergeCommand.php +++ b/src/Command/AutoMergeCommand.php @@ -35,7 +35,7 @@ final class AutoMergeCommand extends AbstractNeedApplyCommand public function __construct( Projects $projects, Repositories $repositories, - LoggerInterface $logger + LoggerInterface $logger, ) { parent::__construct(); @@ -63,7 +63,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $projectNames = $input->getArgument('projects'); if ([] !== $projectNames) { $projects = $this->projects->byNames($projectNames); - $title = sprintf( + $title = \sprintf( '%s for: %s', $title, implode(', ', $projectNames) @@ -78,7 +78,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $this->mergeBranches($project); } catch (ExceptionInterface $e) { - $this->io->error(sprintf( + $this->io->error(\sprintf( 'Failed with message: %s', $e->getMessage() )); @@ -112,20 +112,20 @@ private function mergeBranches(Project $project): void ); if ($successful) { - $this->io->success(sprintf( + $this->io->success(\sprintf( 'Merged %s into %s', $head, $base )); } else { - $this->io->comment(sprintf( + $this->io->comment(\sprintf( 'Nothing to merge on %s', $base )); } } catch (RuntimeException $e) { if (409 === $e->getCode()) { - $message = sprintf( + $message = \sprintf( '%s: Merging of %s into %s contains conflicts. Skipped.', $repository->name(), $head, diff --git a/src/Command/CommentNonMergeablePullRequestsCommand.php b/src/Command/CommentNonMergeablePullRequestsCommand.php index 1bc8468cd..5b4e767c0 100644 --- a/src/Command/CommentNonMergeablePullRequestsCommand.php +++ b/src/Command/CommentNonMergeablePullRequestsCommand.php @@ -42,7 +42,7 @@ public function __construct( PullRequests $pullRequests, Comments $comments, Commits $commits, - Issues $issues + Issues $issues, ) { parent::__construct(); @@ -72,7 +72,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $this->checkPullRequests($project); } catch (ExceptionInterface $e) { - $this->io->error(sprintf( + $this->io->error(\sprintf( 'Failed with message: %s', $e->getMessage() )); @@ -93,7 +93,7 @@ private function checkPullRequests(Project $project): void } foreach ($pullRequests as $pr) { - $this->io->text(sprintf( + $this->io->text(\sprintf( '%s %s (%s)', $pr->issue()->toString(), $pr->title(), @@ -137,11 +137,11 @@ private function checkPullRequests(Project $project): void ); } - $this->io->text(sprintf( + $this->io->text(\sprintf( ' Comment: %s', $message )); - $this->io->text(sprintf( + $this->io->text(\sprintf( ' Label: %s', $label->name() )); diff --git a/src/Command/DependsCommand.php b/src/Command/DependsCommand.php index 2d31260f2..4820e71c9 100644 --- a/src/Command/DependsCommand.php +++ b/src/Command/DependsCommand.php @@ -69,7 +69,7 @@ private function depends(Project $project, int $depth): void continue; } - $this->io->writeln(sprintf( + $this->io->writeln(\sprintf( ' %s', $version->getVersion() )); @@ -80,7 +80,7 @@ private function depends(Project $project, int $depth): void continue; } - $this->io->writeln(sprintf( + $this->io->writeln(\sprintf( ' %s:%s', $packageName, $constraint diff --git a/src/Command/Dispatcher/DispatchBranchesProtectionCommand.php b/src/Command/Dispatcher/DispatchBranchesProtectionCommand.php index fe88c43eb..a9a6a4373 100644 --- a/src/Command/Dispatcher/DispatchBranchesProtectionCommand.php +++ b/src/Command/Dispatcher/DispatchBranchesProtectionCommand.php @@ -59,7 +59,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $projectNames = $input->getArgument('projects'); if ([] !== $projectNames) { $projects = $this->projects->byNames($projectNames); - $title = sprintf( + $title = \sprintf( 'Dispatch branches protection for: %s', implode(', ', $projectNames) ); @@ -73,7 +73,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $this->updateBranchesProtection($project); } catch (ExceptionInterface $e) { - $this->io->error(sprintf( + $this->io->error(\sprintf( 'Failed with message: %s', $e->getMessage() )); @@ -147,7 +147,7 @@ private function buildRequiredStatusChecks(Project $project, Branch $branch): ar 'PHPStan', 'Psalm', 'Rector', - sprintf( + \sprintf( 'PHP %s + lowest + normal', $lowestPhpVersion->toString() ), @@ -174,7 +174,7 @@ private function buildRequiredStatusChecks(Project $project, Branch $branch): ar } foreach ($branch->phpVersions() as $phpVersion) { - $requiredStatusChecks[] = sprintf( + $requiredStatusChecks[] = \sprintf( 'PHP %s + highest + normal', $phpVersion->toString() ); @@ -182,7 +182,7 @@ private function buildRequiredStatusChecks(Project $project, Branch $branch): ar $targetPhp = $branch->targetPhpVersion(); foreach ($branch->variants() as $variant) { - $requiredStatusChecks[] = sprintf( + $requiredStatusChecks[] = \sprintf( 'PHP %s + highest + %s', $targetPhp->toString(), $variant->toString() @@ -190,14 +190,14 @@ private function buildRequiredStatusChecks(Project $project, Branch $branch): ar } if ($project->hasPlatformTests()) { - $requiredStatusChecks[] = sprintf('PHP %s + MySQL 5.7 + highest', $targetPhp->toString()); - $requiredStatusChecks[] = sprintf('PHP %s + MySQL 8.0 + highest', $targetPhp->toString()); - $requiredStatusChecks[] = sprintf('PHP %s + PostgreSQL 13 + highest', $targetPhp->toString()); - $requiredStatusChecks[] = sprintf('PHP %s + PostgreSQL 14 + highest', $targetPhp->toString()); - $requiredStatusChecks[] = sprintf('PHP %s + PostgreSQL 15 + highest', $targetPhp->toString()); + $requiredStatusChecks[] = \sprintf('PHP %s + MySQL 5.7 + highest', $targetPhp->toString()); + $requiredStatusChecks[] = \sprintf('PHP %s + MySQL 8.0 + highest', $targetPhp->toString()); + $requiredStatusChecks[] = \sprintf('PHP %s + PostgreSQL 13 + highest', $targetPhp->toString()); + $requiredStatusChecks[] = \sprintf('PHP %s + PostgreSQL 14 + highest', $targetPhp->toString()); + $requiredStatusChecks[] = \sprintf('PHP %s + PostgreSQL 15 + highest', $targetPhp->toString()); } - $this->io->writeln(sprintf( + $this->io->writeln(\sprintf( 'Required Status-Checks for %s:', $branch->name() )); diff --git a/src/Command/Dispatcher/DispatchFilesCommand.php b/src/Command/Dispatcher/DispatchFilesCommand.php index f567c321d..d1aa3bc04 100644 --- a/src/Command/Dispatcher/DispatchFilesCommand.php +++ b/src/Command/Dispatcher/DispatchFilesCommand.php @@ -61,7 +61,7 @@ public function __construct( Branches $branches, Commits $commits, Filesystem $filesystem, - Environment $twig + Environment $twig, ) { parent::__construct(); @@ -95,7 +95,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $projectNames = $input->getArgument('projects'); if ([] !== $projectNames) { $projects = $this->projects->byNames($projectNames); - $title = sprintf( + $title = \sprintf( 'Dispatch files for: %s', implode(', ', $projectNames) ); @@ -109,7 +109,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $this->dispatchFiles($project); } catch (ExceptionInterface $e) { - $this->io->error(sprintf( + $this->io->error(\sprintf( 'Failed with message: %s', $e->getMessage() )); @@ -145,7 +145,7 @@ private function dispatchFiles(Project $project): void } // Diff application - $this->io->section(sprintf( + $this->io->section(\sprintf( 'Files for %s', $branch->name() )); @@ -180,7 +180,7 @@ private function dispatchFiles(Project $project): void $gitRepository->run('add', ['.', '--all']); - $diff = $gitRepository->run('diff', ['--color', '--cached', sprintf('origin/%s', $branch->name())]); + $diff = $gitRepository->run('diff', ['--color', '--cached', \sprintf('origin/%s', $branch->name())]); if ('' !== $diff) { $this->io->writeln($diff); @@ -199,7 +199,7 @@ private function dispatchFiles(Project $project): void if (!$this->pullRequests->hasOpenPullRequest($repository, $currentHead)) { $pullRequest = $this->pullRequests->create( $repository, - sprintf( + \sprintf( 'DevKit updates for %s branch', $branch->name() ), @@ -229,7 +229,7 @@ private function dispatchFiles(Project $project): void private function deleteNotNeededFilesAndDirs(Project $project, Branch $branch, string $distPath, string $localPath = self::FILES_DIR): void { if (static::FILES_DIR !== $localPath && !str_starts_with($localPath, static::FILES_DIR.'/')) { - throw new \LogicException(sprintf( + throw new \LogicException(\sprintf( 'This method only supports files inside the "%s" directory', static::FILES_DIR )); @@ -282,7 +282,7 @@ private function renderFile(Project $project, Repository $repository, Branch $br { if (static::FILES_DIR !== $localPath) { if (!str_starts_with($localPath, static::FILES_DIR.'/')) { - throw new \LogicException(sprintf( + throw new \LogicException(\sprintf( 'This method only supports files inside the "%s" directory', static::FILES_DIR )); @@ -303,7 +303,7 @@ private function renderFile(Project $project, Repository $repository, Branch $br } } - $localFullPath = sprintf( + $localFullPath = \sprintf( '%s/templates/%s', $this->appDir, $localPath @@ -311,7 +311,7 @@ private function renderFile(Project $project, Repository $repository, Branch $br $localFileType = filetype($localFullPath); if (false === $localFileType) { - throw new \RuntimeException(sprintf( + throw new \RuntimeException(\sprintf( 'Cannot get "%s" file type', $localFullPath )); @@ -319,7 +319,7 @@ private function renderFile(Project $project, Repository $repository, Branch $br $distFileType = $this->filesystem->exists($distPath) ? filetype($distPath) : false; if ($localFileType !== $distFileType && false !== $distFileType) { - throw new \LogicException(sprintf( + throw new \LogicException(\sprintf( 'File type mismatch between "%s" and "%s"', $localPath, $distPath @@ -329,7 +329,7 @@ private function renderFile(Project $project, Repository $repository, Branch $br if ('dir' === $localFileType) { $localDirectory = dir($localFullPath); if (false === $localDirectory) { - throw new \RuntimeException(sprintf( + throw new \RuntimeException(\sprintf( 'Cannot read "%s" dir', $localFullPath )); @@ -352,7 +352,7 @@ private function renderFile(Project $project, Repository $repository, Branch $br $localContent = file_get_contents($localFullPath); if (false === $localContent) { - throw new \RuntimeException(sprintf( + throw new \RuntimeException(\sprintf( 'Cannot read "%s" file content', $localFullPath )); @@ -376,7 +376,7 @@ private function renderFile(Project $project, Repository $repository, Branch $br } if (\array_key_exists('extension', $localPathInfo) && 'twig' === $localPathInfo['extension']) { - $distPath = sprintf( + $distPath = \sprintf( '%s/%s', $distDir, basename($distPath, '.twig') @@ -395,7 +395,7 @@ private function renderFile(Project $project, Repository $repository, Branch $br $res = file_put_contents($distPath, $localContent); if (false === $res) { - throw new \RuntimeException(sprintf( + throw new \RuntimeException(\sprintf( 'Cannot write "%s" file', $distPath )); @@ -403,7 +403,7 @@ private function renderFile(Project $project, Repository $repository, Branch $br $localPerms = fileperms($localFullPath); if (false === $localPerms) { - throw new \RuntimeException(sprintf( + throw new \RuntimeException(\sprintf( 'Cannot read "%s" file perms', $localFullPath )); diff --git a/src/Command/Dispatcher/DispatchHooksCommand.php b/src/Command/Dispatcher/DispatchHooksCommand.php index aba270ab4..5c848dcd6 100644 --- a/src/Command/Dispatcher/DispatchHooksCommand.php +++ b/src/Command/Dispatcher/DispatchHooksCommand.php @@ -48,7 +48,7 @@ final class DispatchHooksCommand extends AbstractNeedApplyCommand public function __construct( Projects $projects, Hooks $hooks, - string $devKitToken + string $devKitToken, ) { parent::__construct(); @@ -79,7 +79,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $this->updateDevKitHook($project); $this->deleteHooks($project); } catch (ExceptionInterface $e) { - $this->io->error(sprintf( + $this->io->error(\sprintf( 'Failed with message: %s', $e->getMessage() )); @@ -98,7 +98,7 @@ private function updateDevKitHook(Project $project): void $devKitHookBaseUrl = 'https://master-7rqtwti-ptm4dx6rjpjko.eu-5.platformsh.site/github'; $config = [ - 'url' => sprintf( + 'url' => \sprintf( '%s?%s', $devKitHookBaseUrl, http_build_query([ @@ -165,7 +165,7 @@ private function updateDevKitHook(Project $project): void $this->io->writeln(' Hook updated.'); } } else { - $this->io->writeln(sprintf( + $this->io->writeln(\sprintf( ' %s', static::LABEL_NOTHING_CHANGED )); @@ -184,7 +184,7 @@ private function deleteHooks(Project $project): void // Check if a Hook should be deleted. foreach ($this->hooks->all($repository) as $hook) { foreach (self::HOOK_URLS_TO_BE_DELETED as $url) { - $this->io->writeln(sprintf( + $this->io->writeln(\sprintf( ' Check if %s starts with %s', $hook->config()->url()->toString(), $url, @@ -192,7 +192,7 @@ private function deleteHooks(Project $project): void if (u($hook->url()->toString())->startsWith($url)) { $deleted = true; - $this->io->writeln(sprintf( + $this->io->writeln(\sprintf( ' Hook "%s" will be deleted', $hook->url()->toString() )); @@ -200,7 +200,7 @@ private function deleteHooks(Project $project): void if ($this->apply) { $this->hooks->remove($repository, $hook); - $this->io->writeln(sprintf( + $this->io->writeln(\sprintf( ' Hook "%s" with ID %s deleted.', $hook->url()->toString(), $hook->id() @@ -211,7 +211,7 @@ private function deleteHooks(Project $project): void } if (!$deleted) { - $this->io->writeln(sprintf( + $this->io->writeln(\sprintf( ' %s', static::LABEL_NOTHING_CHANGED )); diff --git a/src/Command/Dispatcher/DispatchLabelsCommand.php b/src/Command/Dispatcher/DispatchLabelsCommand.php index 07b0787c1..b10ae27b3 100644 --- a/src/Command/Dispatcher/DispatchLabelsCommand.php +++ b/src/Command/Dispatcher/DispatchLabelsCommand.php @@ -35,7 +35,7 @@ final class DispatchLabelsCommand extends AbstractNeedApplyCommand public function __construct( Projects $projects, ConfiguredLabels $configuredLabels, - Labels $labels + Labels $labels, ) { parent::__construct(); @@ -63,7 +63,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $this->updateLabels($project); } catch (ExceptionInterface $e) { - $this->io->error(sprintf( + $this->io->error(\sprintf( 'Failed with message: %s', $e->getMessage() )); diff --git a/src/Command/Dispatcher/DispatchSettingsCommand.php b/src/Command/Dispatcher/DispatchSettingsCommand.php index 318453b8c..8e0a7d964 100644 --- a/src/Command/Dispatcher/DispatchSettingsCommand.php +++ b/src/Command/Dispatcher/DispatchSettingsCommand.php @@ -57,7 +57,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $this->updateRepositories($project); } catch (ExceptionInterface $e) { - $this->io->error(sprintf( + $this->io->error(\sprintf( 'Failed with message: %s', $e->getMessage() )); @@ -101,7 +101,7 @@ private function updateRepositories(Project $project): void $this->io->writeln(' Following info have to be changed:'); foreach ($infoToUpdate as $info => $value) { - $this->io->writeln(sprintf( + $this->io->writeln(\sprintf( ' %s: %s', $info, \is_bool($value) ? ($value ? 'true' : 'false') : $value diff --git a/src/Command/Dispatcher/DispatchTopicsCommand.php b/src/Command/Dispatcher/DispatchTopicsCommand.php index 86423d467..5569742a3 100644 --- a/src/Command/Dispatcher/DispatchTopicsCommand.php +++ b/src/Command/Dispatcher/DispatchTopicsCommand.php @@ -56,7 +56,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $this->updateTopics($project); } catch (ExceptionInterface $e) { - $this->io->error(sprintf( + $this->io->error(\sprintf( 'Failed with message: %s', $e->getMessage() )); @@ -73,7 +73,7 @@ private function updateTopics(Project $project): void $topics = $this->topics->get($repository); if ([] === $topics && [] === $project->topics()) { - $this->io->writeln(sprintf( + $this->io->writeln(\sprintf( ' %s', 'No topics are currently set on the repository, nor new ones are configured!' )); @@ -83,11 +83,11 @@ private function updateTopics(Project $project): void if ($topics !== $project->topics()) { $this->io->writeln(' Topics would be changed...'); - $this->io->writeln(sprintf( + $this->io->writeln(\sprintf( ' from %s', [] === $topics ? '[]' : implode(', ', $topics), )); - $this->io->writeln(sprintf( + $this->io->writeln(\sprintf( ' to %s', [] === $project->topics() ? '[]' : implode(', ', $project->topics()), )); diff --git a/src/Command/ReleaseCommand.php b/src/Command/ReleaseCommand.php index 1c6a24b3e..af9042ce3 100644 --- a/src/Command/ReleaseCommand.php +++ b/src/Command/ReleaseCommand.php @@ -61,7 +61,7 @@ public function __construct( GitManipulator $gitManipulator, PullRequests $pullRequests, Releases $releases, - Issues $issues + Issues $issues, ) { parent::__construct(); @@ -160,7 +160,7 @@ private function selectBranch(InputInterface $input, OutputInterface $output, Pr $default = ($project->stableBranch() ?? $project->unstableBranch())->name(); $question = new ChoiceQuestion( - sprintf('Please select the branch of the project to release: (Default: "%s")', $default), + \sprintf('Please select the branch of the project to release: (Default: "%s")', $default), $project->branchNamesReverse(), $default ); @@ -218,7 +218,7 @@ private function renderNextRelease(Project $project, Branch $branch): ?NextRelea $notificationStyle->section('Release'); if (!$nextRelease->canBeReleased()) { - $notificationStyle->error(sprintf( + $notificationStyle->error(\sprintf( 'Next release would be: %s, but cannot be released yet!', $nextRelease->nextTag()->toString() )); @@ -227,7 +227,7 @@ private function renderNextRelease(Project $project, Branch $branch): ?NextRelea throw new \RuntimeException('Fix labels and changelogs on merged pull requests.'); } - $notificationStyle->success(sprintf( + $notificationStyle->success(\sprintf( 'Next release will be: %s', $nextRelease->nextTag()->toString() )); @@ -244,22 +244,22 @@ private function renderPullRequest(PullRequest $pr): void { $notificationStyle = $this->io->getErrorStyle(); - $notificationStyle->writeln(sprintf( + $notificationStyle->writeln(\sprintf( '%s', $pr->title() )); $notificationStyle->writeln($pr->htmlUrl()); $stability = $pr->stability(); - $notificationStyle->writeln(sprintf( + $notificationStyle->writeln(\sprintf( ' Stability: %s', - $stability->equals(Stability::unknown()) ? sprintf('%s', $stability->toUppercaseString()) : $pr->stability()->toUppercaseString() + $stability->equals(Stability::unknown()) ? \sprintf('%s', $stability->toUppercaseString()) : $pr->stability()->toUppercaseString() )); - $notificationStyle->writeln(sprintf( + $notificationStyle->writeln(\sprintf( ' Labels: %s', $this->renderLabels($pr) )); - $notificationStyle->writeln(sprintf( + $notificationStyle->writeln(\sprintf( ' Changelog: %s', $pr->fulfilledChangelog() ? 'yes' : 'no' )); @@ -279,7 +279,7 @@ private function renderLabels(PullRequest $pr): string } $renderedLabels = array_map( - static fn (Label $label): string => sprintf( + static fn (Label $label): string => \sprintf( '%s', $label->color()->asHexCode(), $label->name() @@ -356,7 +356,7 @@ private function prepareReleasePR(NextRelease $nextRelease): void $this->updateChangelog($gitRepository, $nextRelease); $gitRepository->run('add', ['.', '--all']); - $diff = $gitRepository->run('diff', ['--color', '--cached', sprintf('origin/%s', $nextRelease->branch()->name())]); + $diff = $gitRepository->run('diff', ['--color', '--cached', \sprintf('origin/%s', $nextRelease->branch()->name())]); if ('' !== $diff) { $this->io->writeln($diff); @@ -374,7 +374,7 @@ private function prepareReleasePR(NextRelease $nextRelease): void if (!$this->pullRequests->hasOpenPullRequest($nextRelease->project()->repository(), $currentHead)) { $pullRequest = $this->pullRequests->create( $nextRelease->project()->repository(), - sprintf( + \sprintf( 'Release %s', $nextRelease->nextTag()->toString() ), @@ -402,7 +402,7 @@ private function updateChangelog(Repository $gitRepository, NextRelease $nextRel $changelogFileContents = file_get_contents($changelogFilePath); if (false === $changelogFileContents) { - throw new \RuntimeException(sprintf( + throw new \RuntimeException(\sprintf( 'Cannot read "%s" file', $changelogFilePath )); @@ -413,7 +413,7 @@ private function updateChangelog(Repository $gitRepository, NextRelease $nextRel $res = file_put_contents($changelogFilePath, $replaced); if (false === $res) { - throw new \RuntimeException(sprintf( + throw new \RuntimeException(\sprintf( 'Cannot write "%s" file', $changelogFilePath )); diff --git a/src/Config/ConfiguredLabels.php b/src/Config/ConfiguredLabels.php index 11aabcd4c..7444d3b74 100644 --- a/src/Config/ConfiguredLabels.php +++ b/src/Config/ConfiguredLabels.php @@ -60,7 +60,7 @@ public function byName(string $name): Label Assert::keyExists( $this->labels, $name, - sprintf( + \sprintf( 'Unknown label: %s', $name ) diff --git a/src/Config/Exception/UnknownBranch.php b/src/Config/Exception/UnknownBranch.php index 4328f3243..e1c8c9ee9 100644 --- a/src/Config/Exception/UnknownBranch.php +++ b/src/Config/Exception/UnknownBranch.php @@ -22,7 +22,7 @@ final class UnknownBranch extends \InvalidArgumentException { public static function forName(Project $project, string $name): self { - return new self(sprintf( + return new self(\sprintf( 'Could not find branch with name "%s" for project "%s".', $name, $project->name() diff --git a/src/Config/Exception/UnknownProject.php b/src/Config/Exception/UnknownProject.php index 092c31a01..f867d3e4b 100644 --- a/src/Config/Exception/UnknownProject.php +++ b/src/Config/Exception/UnknownProject.php @@ -20,7 +20,7 @@ final class UnknownProject extends \InvalidArgumentException { public static function forName(string $name): self { - return new self(sprintf( + return new self(\sprintf( 'Could not find project with name "%s".', $name )); diff --git a/src/Config/Projects.php b/src/Config/Projects.php index 051d8fa0b..abfa4a29d 100644 --- a/src/Config/Projects.php +++ b/src/Config/Projects.php @@ -45,7 +45,7 @@ public function __construct(PackagistClient $packagist) foreach ($projectsConfigs['projects'] as $name => $config) { Assert::string($name); - $package = $this->packagist->get(sprintf( + $package = $this->packagist->get(\sprintf( 'sonata-project/%s', $name )); diff --git a/src/Controller/GithubController.php b/src/Controller/GithubController.php index 3a943a246..2bd600161 100644 --- a/src/Controller/GithubController.php +++ b/src/Controller/GithubController.php @@ -68,7 +68,7 @@ public function index(Request $request, HookProcessor $hookProcessor, string $de default: return new JsonResponse( [ - 'message' => sprintf( + 'message' => \sprintf( 'Nothing to do for: %s', $event->toString() ), diff --git a/src/Domain/Exception/CannotGenerateChangelog.php b/src/Domain/Exception/CannotGenerateChangelog.php index f043f9b0a..4fa167a33 100644 --- a/src/Domain/Exception/CannotGenerateChangelog.php +++ b/src/Domain/Exception/CannotGenerateChangelog.php @@ -23,7 +23,7 @@ final class CannotGenerateChangelog extends \LogicException public static function forRelease(NextRelease $nextRelease, ?\Throwable $previous = null): self { return new self( - sprintf( + \sprintf( 'Release "%s" cannot be released yet. Please check labels and changelogs of the pull requests.', $nextRelease->nextTag()->toString() ), diff --git a/src/Domain/Exception/NoBranchesAvailable.php b/src/Domain/Exception/NoBranchesAvailable.php index 310b84b33..c49c50127 100644 --- a/src/Domain/Exception/NoBranchesAvailable.php +++ b/src/Domain/Exception/NoBranchesAvailable.php @@ -23,7 +23,7 @@ final class NoBranchesAvailable extends \InvalidArgumentException public static function forProject(Project $project, ?\Throwable $previous = null): self { return new self( - sprintf( + \sprintf( 'Project "%s" has no branches configured.', $project->name() ), diff --git a/src/Domain/Value/Branch.php b/src/Domain/Value/Branch.php index 60b00d6c8..723854037 100644 --- a/src/Domain/Value/Branch.php +++ b/src/Domain/Value/Branch.php @@ -66,7 +66,7 @@ private function __construct( bool $frontendTests, Path $docsPath, Path $testsPath, - ?PhpVersion $targetPhpVersion + ?PhpVersion $targetPhpVersion, ) { $this->name = TrimmedNonEmptyString::fromString($name)->toString(); $this->phpVersions = $phpVersions; diff --git a/src/Domain/Value/Changelog.php b/src/Domain/Value/Changelog.php index 086006b4d..d2767f4f3 100644 --- a/src/Domain/Value/Changelog.php +++ b/src/Domain/Value/Changelog.php @@ -52,7 +52,7 @@ public static function fromValues(string $headline, array $sections): self */ public static function fromPullRequests(array $pullRequests, Tag $next, Tag $current, Package $package): self { - $headline = sprintf( + $headline = \sprintf( '## [%s](%s/compare/%s...%s) - %s', $next->toString(), $package->getRepository(), diff --git a/src/Domain/Value/Changelog/Section.php b/src/Domain/Value/Changelog/Section.php index dc43e3dac..e2ec8dc42 100644 --- a/src/Domain/Value/Changelog/Section.php +++ b/src/Domain/Value/Changelog/Section.php @@ -78,7 +78,7 @@ public function asMarkdown(): string { return implode(\PHP_EOL, array_merge( [ - sprintf( + \sprintf( '### %s', $this->headline ), diff --git a/src/Domain/Value/NextRelease.php b/src/Domain/Value/NextRelease.php index 7f8644123..e4c5f8988 100644 --- a/src/Domain/Value/NextRelease.php +++ b/src/Domain/Value/NextRelease.php @@ -47,7 +47,7 @@ private function __construct( Tag $currentTag, CombinedStatus $combinedStatus, CheckRuns $checkRuns, - array $pullRequests + array $pullRequests, ) { $this->project = $project; $this->branch = $branch; @@ -72,7 +72,7 @@ public static function fromValues( Tag $currentTag, CombinedStatus $combinedStatus, CheckRuns $checkRuns, - array $pullRequests + array $pullRequests, ): self { return new self( $project, diff --git a/src/Domain/Value/Project.php b/src/Domain/Value/Project.php index 0672211f3..f5235f240 100644 --- a/src/Domain/Value/Project.php +++ b/src/Domain/Value/Project.php @@ -70,7 +70,7 @@ private function __construct( bool $hasDocumentation, bool $hasTestKernel, bool $hasPlatformTests, - ?string $documentationBadgeSlug + ?string $documentationBadgeSlug, ) { $this->name = TrimmedNonEmptyString::fromString($name)->toString(); $this->bundle = u($this->name)->endsWith('bundle') ? true : false; diff --git a/src/Domain/Value/Variant.php b/src/Domain/Value/Variant.php index 00dc189c7..473073d3f 100644 --- a/src/Domain/Value/Variant.php +++ b/src/Domain/Value/Variant.php @@ -51,7 +51,7 @@ public function version(): string public function toString(): string { - return sprintf( + return \sprintf( '%s:"%s"', $this->package, $this->version diff --git a/src/Git/GitManipulator.php b/src/Git/GitManipulator.php index 67b2aaeb9..1b6259858 100644 --- a/src/Git/GitManipulator.php +++ b/src/Git/GitManipulator.php @@ -30,7 +30,7 @@ final class GitManipulator public function __construct( Filesystem $filesystem, - string $githubToken + string $githubToken, ) { $this->filesystem = $filesystem; $this->githubToken = $githubToken; @@ -40,7 +40,7 @@ public function gitCloneProject(Project $project): Repository { $repository = $project->repository(); - $clonePath = sprintf( + $clonePath = \sprintf( '%s/%s', sys_get_temp_dir(), $repository->toString() @@ -52,7 +52,7 @@ public function gitCloneProject(Project $project): Repository $repository = Admin::cloneRepository( $clonePath, - sprintf( + \sprintf( 'https://%s:%s@github.com/%s/%s', $repository->username(), $this->githubToken, @@ -77,12 +77,12 @@ public function prepareBranch(Repository $repository, Branch $branch, string $su if ($repository->getReferences()->hasBranch($branch->name())) { $repository->run('checkout', [$branch->name()]); } else { - $repository->run('checkout', ['-b', $branch->name(), '--track', sprintf('origin/%s', $branch->name())]); + $repository->run('checkout', ['-b', $branch->name(), '--track', \sprintf('origin/%s', $branch->name())]); } // Checkout the dev-kit branch - if ($repository->getReferences()->hasRemoteBranch(sprintf('origin/%s', $devKitBranchName))) { - $repository->run('checkout', ['-b', $devKitBranchName, '--track', sprintf('origin/%s', $devKitBranchName)]); + if ($repository->getReferences()->hasRemoteBranch(\sprintf('origin/%s', $devKitBranchName))) { + $repository->run('checkout', ['-b', $devKitBranchName, '--track', \sprintf('origin/%s', $devKitBranchName)]); } else { $repository->run('checkout', ['-b', $devKitBranchName]); } diff --git a/src/Github/Domain/Value/CheckRun.php b/src/Github/Domain/Value/CheckRun.php index 2b444eaa6..77481c832 100644 --- a/src/Github/Domain/Value/CheckRun.php +++ b/src/Github/Domain/Value/CheckRun.php @@ -125,20 +125,20 @@ public function name(): string public function nameFormatted(): string { if (self::CONCLUSION_SUCCESS === $this->conclusion) { - return sprintf( + return \sprintf( '%s', $this->name ); } if (self::CONCLUSION_NEUTRAL === $this->conclusion) { - return sprintf( + return \sprintf( '%s', $this->name ); } - return sprintf( + return \sprintf( '%s', $this->name ); diff --git a/src/Github/Domain/Value/CombinedStatus.php b/src/Github/Domain/Value/CombinedStatus.php index ea78b799a..cca8d1dd4 100644 --- a/src/Github/Domain/Value/CombinedStatus.php +++ b/src/Github/Domain/Value/CombinedStatus.php @@ -65,7 +65,7 @@ public static function fromResponse(array $response): self if (self::PENDING !== $state) { Assert::notEmpty( $response['statuses'], - sprintf( + \sprintf( 'Status is "%s", no empty statuses array allowed for CominedStatus!', $state ) diff --git a/src/Github/Domain/Value/PullRequest.php b/src/Github/Domain/Value/PullRequest.php index b8d5a22b4..61fd160e9 100644 --- a/src/Github/Domain/Value/PullRequest.php +++ b/src/Github/Domain/Value/PullRequest.php @@ -54,7 +54,7 @@ private function __construct( ?bool $mergeable, string $body, string $htmlUrl, - array $labels + array $labels, ) { $this->issue = $issue; $this->title = TrimmedNonEmptyString::fromString($title)->toString(); @@ -293,7 +293,7 @@ public function changelog(): array $section = preg_replace('/^#* /i', '', $line) ?? ''; } elseif ('' !== $section) { $line = preg_replace('/^- /i', '', $line) ?? ''; - $changelog[$section][] = sprintf( + $changelog[$section][] = \sprintf( '- [[#%s](%s)] %s ([@%s](%s))', $this->issue->toInt(), $this->htmlUrl, diff --git a/src/Github/Domain/Value/Repository.php b/src/Github/Domain/Value/Repository.php index 08cc7f680..8a4a60c44 100644 --- a/src/Github/Domain/Value/Repository.php +++ b/src/Github/Domain/Value/Repository.php @@ -59,7 +59,7 @@ public function name(): string public function toString(): string { - return sprintf( + return \sprintf( '%s/%s', $this->username, $this->name diff --git a/src/Github/Domain/Value/Search/Query.php b/src/Github/Domain/Value/Search/Query.php index f59d752af..6cd3195ff 100644 --- a/src/Github/Domain/Value/Search/Query.php +++ b/src/Github/Domain/Value/Search/Query.php @@ -46,7 +46,7 @@ public static function fromString(string $value): self public static function pullRequests(Repository $repository, Branch $branch, Label $excludedLabel): self { return new self( - sprintf( + \sprintf( 'repo:%s type:pr is:merged base:%s -label:%s', $repository->toString(), $branch->name(), @@ -58,7 +58,7 @@ public static function pullRequests(Repository $repository, Branch $branch, Labe public static function pullRequestsSince(Repository $repository, Branch $branch, \DateTimeImmutable $date, Label $excludedLabel): self { return new self( - sprintf( + \sprintf( 'repo:%s type:pr is:merged base:%s merged:>%s -label:%s', $repository->toString(), $branch->name(), diff --git a/src/Github/Domain/Value/Status.php b/src/Github/Domain/Value/Status.php index 466d6e84f..1d521af61 100644 --- a/src/Github/Domain/Value/Status.php +++ b/src/Github/Domain/Value/Status.php @@ -93,20 +93,20 @@ public function context(): string public function contextFormatted(): string { if (self::SUCCESS === $this->state) { - return sprintf( + return \sprintf( '%s', $this->context ); } if (self::PENDING === $this->state) { - return sprintf( + return \sprintf( '%s', $this->context ); } - return sprintf( + return \sprintf( '%s', $this->context ); diff --git a/src/Github/Domain/Value/User.php b/src/Github/Domain/Value/User.php index 70709873f..ab20057ff 100644 --- a/src/Github/Domain/Value/User.php +++ b/src/Github/Domain/Value/User.php @@ -71,7 +71,7 @@ public function login(): string */ public function handle(): string { - return sprintf( + return \sprintf( '@%s', $this->login ); diff --git a/src/Github/Exception/LatestReleaseNotFound.php b/src/Github/Exception/LatestReleaseNotFound.php index 325b5cce8..7dd0242b6 100644 --- a/src/Github/Exception/LatestReleaseNotFound.php +++ b/src/Github/Exception/LatestReleaseNotFound.php @@ -24,7 +24,7 @@ final class LatestReleaseNotFound extends \RuntimeException public static function forRepository(Repository $repository, ?\Throwable $previous = null): self { return new self( - sprintf( + \sprintf( 'Could not find latest Release for "%s".', $repository->toString() ), @@ -36,7 +36,7 @@ public static function forRepository(Repository $repository, ?\Throwable $previo public static function forRepositoryAndBranch(Repository $repository, Branch $branch, ?\Throwable $previous = null): self { return new self( - sprintf( + \sprintf( 'Could not find latest Release for the branch "%s" of "%s".', $branch->name(), $repository->toString() diff --git a/src/Github/HookProcessor.php b/src/Github/HookProcessor.php index 7b591c418..54be184e0 100644 --- a/src/Github/HookProcessor.php +++ b/src/Github/HookProcessor.php @@ -132,7 +132,7 @@ public function magicAction(Payload $payload): void foreach ($magicActions as $body => $filename) { if ($body !== $comment->body()) { - $this->logger->debug(sprintf( + $this->logger->debug(\sprintf( 'Comment is not "%s", skipping!', $body )); @@ -142,14 +142,14 @@ public function magicAction(Payload $payload): void $repository = Repository::fromIncomingWebhookPayload($payload); - $filepath = sprintf( + $filepath = \sprintf( '%s/../../templates/github/%s', __DIR__, $filename ); if (!file_exists($filepath)) { - $this->logger->debug(sprintf( + $this->logger->debug(\sprintf( 'Could not find file "%s" for "%s", skipping!', $filepath, $body @@ -178,7 +178,7 @@ public function magicAction(Payload $payload): void ); if ('/request-release' === $body) { - $message = sprintf( + $message = \sprintf( '%s requested a release for %s in %s', $comment->author()->handle(), $payload->repository()->name(), @@ -241,7 +241,7 @@ public function magicComment(Payload $payload): void foreach ($magicComments as $body => $filename) { if ($body !== $comment->body()) { - $this->logger->debug(sprintf( + $this->logger->debug(\sprintf( 'Comment is not "%s", skipping!', $body )); @@ -251,14 +251,14 @@ public function magicComment(Payload $payload): void $repository = Repository::fromIncomingWebhookPayload($payload); - $filepath = sprintf( + $filepath = \sprintf( '%s/../../templates/github/%s', __DIR__, $filename ); if (!file_exists($filepath)) { - $this->logger->debug(sprintf( + $this->logger->debug(\sprintf( 'Could not find file "%s" for "%s", skipping!', $filepath, $body diff --git a/src/Twig/Extension/FileSystemExtension.php b/src/Twig/Extension/FileSystemExtension.php index 22c2efec6..357ff2380 100644 --- a/src/Twig/Extension/FileSystemExtension.php +++ b/src/Twig/Extension/FileSystemExtension.php @@ -48,7 +48,7 @@ public function hasDependency(string $projectDir, string $dependency): bool $composerPath = $projectDir.'/composer.json'; $composerContent = file_get_contents($composerPath); if (false === $composerContent) { - throw new IOException(sprintf('Cannot read composer.json at path "%s"', $composerPath)); + throw new IOException(\sprintf('Cannot read composer.json at path "%s"', $composerPath)); } return str_contains($composerContent, $dependency); diff --git a/tests/Action/Exception/NoPullRequestMergedSinceLastReleaseTest.php b/tests/Action/Exception/NoPullRequestMergedSinceLastReleaseTest.php index a3e7bfdb4..3ee88b1cd 100644 --- a/tests/Action/Exception/NoPullRequestMergedSinceLastReleaseTest.php +++ b/tests/Action/Exception/NoPullRequestMergedSinceLastReleaseTest.php @@ -58,7 +58,7 @@ public function testForProject(): void $cannotDetermineNextRelease ); static::assertSame( - sprintf( + \sprintf( 'No pull requests merged since last release "%s" for branch "%s" of project "%s".', $datetime, $branch->name(), diff --git a/tests/Config/Exception/UnknownBranchTest.php b/tests/Config/Exception/UnknownBranchTest.php index 48630d6e1..66c710a59 100644 --- a/tests/Config/Exception/UnknownBranchTest.php +++ b/tests/Config/Exception/UnknownBranchTest.php @@ -53,7 +53,7 @@ public function testForName(): void $unknownBranch ); static::assertSame( - sprintf( + \sprintf( 'Could not find branch with name "%s" for project "%s".', $name, $project->name() diff --git a/tests/Config/Exception/UnknownProjectTest.php b/tests/Config/Exception/UnknownProjectTest.php index c104befe4..fb231f150 100644 --- a/tests/Config/Exception/UnknownProjectTest.php +++ b/tests/Config/Exception/UnknownProjectTest.php @@ -32,7 +32,7 @@ public function testForName(): void $unknownProject ); static::assertSame( - sprintf( + \sprintf( 'Could not find project with name "%s".', $name ), diff --git a/tests/Domain/Exception/NoBranchesAvaillableTest.php b/tests/Domain/Exception/NoBranchesAvaillableTest.php index 18c54bac6..af409f9ee 100644 --- a/tests/Domain/Exception/NoBranchesAvaillableTest.php +++ b/tests/Domain/Exception/NoBranchesAvaillableTest.php @@ -51,7 +51,7 @@ public function testForProject(): void $noBranchesAvailable ); static::assertSame( - sprintf( + \sprintf( 'Project "%s" has no branches configured.', $project->name() ), diff --git a/tests/Github/Domain/Value/Issue/IssueTest.php b/tests/Github/Domain/Value/Issue/IssueTest.php index e3f8ca63a..fa5cbee36 100644 --- a/tests/Github/Domain/Value/Issue/IssueTest.php +++ b/tests/Github/Domain/Value/Issue/IssueTest.php @@ -42,7 +42,7 @@ public function testFromInt(): void ); static::assertSame( - sprintf( + \sprintf( '#%s', $value ), diff --git a/tests/Github/Domain/Value/Label/ColorTest.php b/tests/Github/Domain/Value/Label/ColorTest.php index 072420a2d..37a4b652d 100644 --- a/tests/Github/Domain/Value/Label/ColorTest.php +++ b/tests/Github/Domain/Value/Label/ColorTest.php @@ -13,7 +13,6 @@ namespace App\Tests\Github\Domain\Value\Label; -use App\Github\Domain\Value\Label; use App\Github\Domain\Value\Label\Color; use PHPUnit\Framework\TestCase; @@ -67,7 +66,7 @@ public function testEquals(bool $expected, Color $color, Color $other): void } /** - * @return iterable + * @return iterable */ public function provideEqualsCases(): iterable { diff --git a/tests/Github/Domain/Value/PullRequestTest.php b/tests/Github/Domain/Value/PullRequestTest.php index 173630bee..8d67a7c97 100644 --- a/tests/Github/Domain/Value/PullRequestTest.php +++ b/tests/Github/Domain/Value/PullRequestTest.php @@ -371,7 +371,7 @@ public function provideStabilityCases(): iterable public function testBody(): void { $response = PullRequestFactory::create([ - 'body' => sprintf( + 'body' => \sprintf( << diff --git a/tests/Github/Exception/LatestReleaseNotFoundTest.php b/tests/Github/Exception/LatestReleaseNotFoundTest.php index ff4983a42..46c355345 100644 --- a/tests/Github/Exception/LatestReleaseNotFoundTest.php +++ b/tests/Github/Exception/LatestReleaseNotFoundTest.php @@ -40,7 +40,7 @@ public function testForRepository(): void $latestReleaseNotFound ); static::assertSame( - sprintf( + \sprintf( 'Could not find latest Release for "%s".', $repository->toString() ), diff --git a/tests/Util/Factory/Github/Response/PullRequestFactory.php b/tests/Util/Factory/Github/Response/PullRequestFactory.php index be99a6c47..7b8ad906d 100644 --- a/tests/Util/Factory/Github/Response/PullRequestFactory.php +++ b/tests/Util/Factory/Github/Response/PullRequestFactory.php @@ -50,7 +50,7 @@ public static function create(array $parameters = []): array ], 'user' => UserFactory::create(), 'mergeable' => $faker->boolean(), - 'body' => sprintf( + 'body' => \sprintf( <<<'BODY'