Split meta architecture contracts

This commit is contained in:
2026-03-19 18:52:36 +01:00
parent ac9cc4955a
commit b9f566c49f
12 changed files with 447 additions and 411 deletions

View File

@@ -0,0 +1,46 @@
<?php
namespace MintyPHP\Tests\Architecture;
trait CodexDocsContractSupport
{
/**
* @return list<string>
*/
private function filesCoveredByDocsLinkIntegrityCheck(): array
{
$root = dirname(__DIR__, 2);
$files = ['README.md'];
$scanDirs = ['docs', '.agents'];
foreach ($scanDirs as $scanDir) {
$directory = new \RecursiveDirectoryIterator(
$root . '/' . $scanDir,
\FilesystemIterator::SKIP_DOTS
);
$iterator = new \RecursiveIteratorIterator($directory);
foreach ($iterator as $fileInfo) {
if (!$fileInfo->isFile()) {
continue;
}
$fullPath = str_replace('\\', '/', $fileInfo->getPathname());
if (!str_ends_with($fullPath, '.md')) {
continue;
}
$relative = ltrim(str_replace(str_replace('\\', '/', $root), '', $fullPath), '/');
if (str_starts_with($relative, '.agents/runs/')) {
continue;
}
$files[] = $relative;
}
}
$files = array_values(array_unique($files));
sort($files);
return $files;
}
}