getRealPath(); if (! is_string($path)) { continue; } foreach ($allowedPathFragments as $fragment) { if (str_contains($path, $fragment)) { continue 2; } } $contents = File::get($path); foreach ($forbiddenPatterns as $pattern) { if (preg_match($pattern, $contents) === 1) { $violations[] = $path; break; } } } } expect($violations) ->toBeEmpty('Remove usages of `users.is_platform_superadmin` / `isPlatformSuperadmin()` from runtime code and tests. Found in: '.implode(', ', $violations)); });