Skip to content

Commit de5f4d8

Browse files
committed
minor fixes
1 parent 3b5e735 commit de5f4d8

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
@@ -94,19 +94,14 @@ public function writeLinterMessage(OutputInterface $output): void
9494

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

104-
foreach ($pathCandidates as $pathCandidate) {
105-
if (is_file($pathCandidate)) {
106-
$this->phpCsFixerBinaryPath = $pathCandidate;
101+
if (is_file($shimLocation)) {
102+
$this->phpCsFixerBinaryPath = $shimLocation;
107103

108-
return;
109-
}
104+
return;
110105
}
111106

112107
return;

tests/Util/TemplateLinterTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ public function testPhpCsFixerVersion(): void
4646
}
4747

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

5153
$process = Process::fromShellCommandline(sprintf('%s -V', $fixerPath));
5254

0 commit comments

Comments
 (0)