Skip to content

Commit 86c658d

Browse files
committed
minor fixes
1 parent 902eba9 commit 86c658d

File tree

3 files changed

+9
-12
lines changed

3 files changed

+9
-12
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"php": ">=8.1",
1717
"doctrine/inflector": "^2.0",
1818
"nikic/php-parser": "^4.18|^5.0",
19-
"php-cs-fixer/shim": "^v3.59.3",
19+
"php-cs-fixer/shim": "^v3.64",
2020
"symfony/config": "^6.4|^7.0",
2121
"symfony/console": "^6.4|^7.0",
2222
"symfony/dependency-injection": "^6.4|^7.0",

src/Util/TemplateLinter.php

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -95,19 +95,14 @@ public function writeLinterMessage(OutputInterface $output): void
9595

9696
private function setBinary(): void
9797
{
98-
// Use Bundled PHP-CS-Fixer
98+
// Use Bundled (shim) PHP-CS-Fixer
9999
if (null === $this->phpCsFixerBinaryPath) {
100-
$pathCandidates = [
101-
__DIR__.'/../../vendor/php-cs-fixer/shim/php-cs-fixer',
102-
__DIR__.'/../../../php-cs-fixer/shim/php-cs-fixer',
103-
];
100+
$shimLocation = \sprintf('%s/vendor/bin/php-cs-fixer', \dirname(__DIR__, 2));
104101

105-
foreach ($pathCandidates as $pathCandidate) {
106-
if (is_file($pathCandidate)) {
107-
$this->phpCsFixerBinaryPath = $pathCandidate;
102+
if (is_file($shimLocation)) {
103+
$this->phpCsFixerBinaryPath = $shimLocation;
108104

109-
return;
110-
}
105+
return;
111106
}
112107

113108
return;

tests/Util/TemplateLinterTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ public function testPhpCsFixerVersion(): void
4444
$this->markTestSkippedOnWindows();
4545

4646
$fixerPath = __DIR__.'/../../vendor/php-cs-fixer/shim/php-cs-fixer';
47-
$expectedVersion = InstalledVersions::getVersion('php-cs-fixer/shim');
47+
48+
// Get the installed version and remove the preceding "v"
49+
$expectedVersion = ltrim(InstalledVersions::getPrettyVersion('php-cs-fixer/shim'), 'v');
4850

4951
$process = Process::fromShellCommandline(\sprintf('%s -V', $fixerPath));
5052

0 commit comments

Comments
 (0)