filter(fn (\SplFileInfo $file): bool => $file->isFile() && $file->getExtension() === 'php') ->map(fn (\SplFileInfo $file): string => $file->getPathname()) ->values(); expect($paths)->not->toBeEmpty(); $violations = []; foreach ($paths as $path) { $contents = file_get_contents($path); if ($contents === false) { continue; } if (Str::contains($contents, ['sleep(', 'usleep('])) { $violations[] = $path; } } expect($violations)->toBe([]); });