Skip to content

Commit a6101ca

Browse files
committed
Merge remote-tracking branch 'origin/1.12.x' into 2.0.x
2 parents 9b91afb + 83bf3ab commit a6101ca

File tree

4 files changed

+176
-107
lines changed

4 files changed

+176
-107
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"nikic/php-parser": "^5.2.0",
2626
"ondram/ci-detector": "^3.4.0",
2727
"ondrejmirtes/better-reflection": "6.42.0.8",
28-
"phpstan/php-8-stubs": "0.3.104",
28+
"phpstan/php-8-stubs": "0.3.105",
2929
"phpstan/phpdoc-parser": "^2.0",
3030
"psr/http-message": "^1.1",
3131
"react/async": "^3",

composer.lock

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Testing/TypeInferenceTestCase.php

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -279,25 +279,38 @@ public static function gatherAssertTypes(string $file): array
279279
* @return array<string, mixed[]>
280280
*/
281281
public static function gatherAssertTypesFromDirectory(string $directory): array
282+
{
283+
$asserts = [];
284+
foreach (self::findTestDataFilesFromDirectory($directory) as $path) {
285+
foreach (self::gatherAssertTypes($path) as $key => $assert) {
286+
$asserts[$key] = $assert;
287+
}
288+
}
289+
290+
return $asserts;
291+
}
292+
293+
/**
294+
* @return list<string>
295+
*/
296+
public static function findTestDataFilesFromDirectory(string $directory): array
282297
{
283298
if (!is_dir($directory)) {
284299
self::fail(sprintf('Directory %s does not exist.', $directory));
285300
}
286301

287302
$finder = new Finder();
288303
$finder->followLinks();
289-
$asserts = [];
304+
$files = [];
290305
foreach ($finder->files()->name('*.php')->in($directory) as $fileInfo) {
291306
$path = $fileInfo->getPathname();
292307
if (self::isFileLintSkipped($path)) {
293308
continue;
294309
}
295-
foreach (self::gatherAssertTypes($path) as $key => $assert) {
296-
$asserts[$key] = $assert;
297-
}
310+
$files[] = $path;
298311
}
299312

300-
return $asserts;
313+
return $files;
301314
}
302315

303316
/**

0 commit comments

Comments
 (0)