Skip to content

Commit aca42cc

Browse files
minor symfony#64357 [ErrorHandler][HttpClient][Translation] Fix edge case spotted by the CI (nicolas-grekas)
This PR was merged into the 6.4 branch. Discussion ---------- [ErrorHandler][HttpClient][Translation] Fix edge case spotted by the CI | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | - | License | MIT Commits ------- 51c5188 [ErrorHandler][HttpClient][Translation] Fix edge case spotted by the CI
2 parents 36b0d99 + 51c5188 commit aca42cc

3 files changed

Lines changed: 16 additions & 4 deletions

File tree

src/Symfony/Component/ErrorHandler/ErrorEnhancer/ClassNotFoundErrorEnhancer.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,14 @@ private function findClassInPath(string $path, string $class, string $prefix): a
114114

115115
$classes = [];
116116
$filename = $class.'.php';
117-
foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($path, \RecursiveDirectoryIterator::SKIP_DOTS), \RecursiveIteratorIterator::LEAVES_ONLY) as $file) {
118-
if ($filename == $file->getFileName() && $class = $this->convertFileToClass($path, $file->getPathName(), $prefix)) {
119-
$classes[] = $class;
117+
try {
118+
foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($path, \RecursiveDirectoryIterator::SKIP_DOTS), \RecursiveIteratorIterator::LEAVES_ONLY) as $file) {
119+
if ($filename == $file->getFileName() && $class = $this->convertFileToClass($path, $file->getPathName(), $prefix)) {
120+
$classes[] = $class;
121+
}
120122
}
123+
} catch (\UnexpectedValueException) {
124+
// a subdirectory may vanish between listing and recursion (e.g. test fixtures)
121125
}
122126

123127
return $classes;

src/Symfony/Component/HttpClient/Tests/AmpHttpClientTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ public function testNonBlockingStream()
2727
parent::testNonBlockingStream();
2828
}
2929

30+
/**
31+
* @group transient-on-windows
32+
*/
33+
public function testResolve()
34+
{
35+
parent::testResolve();
36+
}
37+
3038
protected function getHttpClient(string $testCase): HttpClientInterface
3139
{
3240
return new AmpHttpClient(['verify_peer' => false, 'verify_host' => false, 'timeout' => 5]);

src/Symfony/Component/Translation/Command/TranslationPushCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,6 @@ private function getDomainsFromTranslatorBag(TranslatorBag $translatorBag): arra
177177
$domains = array_merge($domains, $catalogue->getDomains());
178178
}
179179

180-
return array_unique($domains);
180+
return array_values(array_unique($domains));
181181
}
182182
}

0 commit comments

Comments
 (0)