This commit is contained in:
nuno maduro
2026-05-04 08:02:09 -03:00
parent b828ddcec7
commit d17be9decd
5 changed files with 7 additions and 7 deletions

View File

@ -1289,7 +1289,7 @@ final class Graph
/** @param array<string, array<int, string>> $edges */ /** @param array<string, array<int, string>> $edges */
private function anyTestUses(array $edges, string $component): bool private function anyTestUses(array $edges, string $component): bool
{ {
return array_any($edges, fn ($components): bool => in_array($component, $components, true)); return array_any($edges, fn (array $components): bool => in_array($component, $components, true));
} }
public function pruneMissingTests(): void public function pruneMissingTests(): void

View File

@ -386,6 +386,6 @@ final class JsModuleGraph
private static function hasViteConfig(string $projectRoot): bool private static function hasViteConfig(string $projectRoot): bool
{ {
return array_any(self::VITE_CONFIG_NAMES, fn ($name): bool => is_file($projectRoot.DIRECTORY_SEPARATOR.$name)); return array_any(self::VITE_CONFIG_NAMES, fn (string $name): bool => is_file($projectRoot.DIRECTORY_SEPARATOR.$name));
} }
} }

View File

@ -23,7 +23,7 @@ final class TableExtractor
} }
$prefix = strtolower(substr($trimmed, 0, 6)); $prefix = strtolower(substr($trimmed, 0, 6));
$matched = array_any(self::DML_PREFIXES, fn ($dml): bool => str_starts_with($prefix, (string) $dml)); $matched = array_any(self::DML_PREFIXES, fn (string $dml): bool => str_starts_with($prefix, $dml));
if (! $matched) { if (! $matched) {
return []; return [];

View File

@ -94,7 +94,7 @@ final readonly class TestPaths
if (in_array($relativePath, $this->files, true)) { if (in_array($relativePath, $this->files, true)) {
return true; return true;
} }
$matchesSuffix = array_any($this->suffixes, fn ($suffix): bool => str_ends_with($relativePath, (string) $suffix)); $matchesSuffix = array_any($this->suffixes, fn (string $suffix): bool => str_ends_with($relativePath, $suffix));
if (! $matchesSuffix) { if (! $matchesSuffix) {
return false; return false;

View File

@ -253,17 +253,17 @@ final class WatchPatterns
private function patternTargetsDotfiles(string $pattern): bool private function patternTargetsDotfiles(string $pattern): bool
{ {
return array_any(explode('/', str_replace('\\', '/', $pattern)), fn ($segment): bool => $segment !== '' && $segment[0] === '.'); return array_any(explode('/', str_replace('\\', '/', $pattern)), fn (string $segment): bool => $segment !== '' && $segment[0] === '.');
} }
private function touchesVcs(string $file): bool private function touchesVcs(string $file): bool
{ {
return array_any(explode('/', $file), fn ($segment): bool => in_array($segment, self::VCS_DIRS, true)); return array_any(explode('/', $file), fn (string $segment): bool => in_array($segment, self::VCS_DIRS, true));
} }
private function touchesDotfile(string $file): bool private function touchesDotfile(string $file): bool
{ {
return array_any(explode('/', $file), fn ($segment): bool => $segment !== '' && $segment[0] === '.'); return array_any(explode('/', $file), fn (string $segment): bool => $segment !== '' && $segment[0] === '.');
} }
private function excludeMatches(string $exclude, string $file): bool private function excludeMatches(string $exclude, string $file): bool