flatMap(fn (string $dir) => File::allFiles($dir)) ->filter(fn ($file) => str_ends_with($file->getFilename(), '.php')) ->filter(fn ($file) => str_contains($file->getContents(), 'withoutGlobalScopes()')) ->map(fn ($file) => str_replace(base_path().'/', '', $file->getPathname())) ->sort() ->values() ->all(); expect(array_values(array_diff($hits, $allowed)))->toBe([], 'Neue Stelle mit withoutGlobalScopes() ohne Argument – bitte withoutGlobalScope(PortalScope::class) verwenden oder die Ausnahme hier begründen.'); });