isFile()) { continue; } $path = $file->getRealPath(); if (! is_string($path) || $path === $self || ! preg_match('/\.(blade\.php|php|js|ts|vue|json)$/', $path)) { continue; } $contents = file_get_contents($path); if (! is_string($contents)) { continue; } foreach ($forbiddenTerms as $term) { if (str_contains($contents, $term)) { $violations[] = str_replace(base_path().DIRECTORY_SEPARATOR, '', $path).': '.$term; } } } } expect($violations)->toBeEmpty(); });