getExtension() !== 'phtml') { continue; } $path = $file->getPathname(); $content = file_get_contents($path); if (!is_string($content)) { continue; } foreach ($moduleIds as $moduleId) { if (preg_match("/layoutNav\[['\"]" . preg_quote($moduleId, '/') . "(\\.|['\"])" . "/", $content) === 1) { $violations[] = str_replace($projectRoot . '/', '', $path) . ' references layoutNav module key for ' . $moduleId; } } } self::assertSame([], $violations, "Core templates reference module layout keys:\n" . implode("\n", $violations)); } }