2026-03-19 18:25:19 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace MintyPHP\Tests\Architecture;
|
|
|
|
|
|
|
|
|
|
trait ListContractFiles
|
|
|
|
|
{
|
|
|
|
|
private function readTemplatePageModule(string $templateFile): string
|
|
|
|
|
{
|
|
|
|
|
$template = $this->readProjectFile($templateFile);
|
|
|
|
|
$matched = preg_match(
|
|
|
|
|
"/assetVersion\\('((?:modules\\/[^\\/]+\\/)?js\\/pages\\/[^']+\\.js)'\\)/",
|
|
|
|
|
$template,
|
|
|
|
|
$captures
|
|
|
|
|
);
|
|
|
|
|
$this->assertSame(1, $matched, $templateFile . ' must reference a page module via assetVersion().');
|
|
|
|
|
|
|
|
|
|
$assetPath = ltrim($captures[1], '/');
|
|
|
|
|
$webPath = 'web/' . $assetPath;
|
|
|
|
|
$root = $this->projectRootPath();
|
|
|
|
|
|
|
|
|
|
if (is_file($root . '/' . $webPath)) {
|
|
|
|
|
return $this->readProjectFile($webPath);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (str_starts_with($assetPath, 'modules/')) {
|
|
|
|
|
$sourcePath = preg_replace('#^modules/([^/]+)/#', 'modules/$1/web/', $assetPath, 1);
|
|
|
|
|
$this->assertIsString($sourcePath, 'Could not resolve module asset path for ' . $templateFile);
|
|
|
|
|
|
|
|
|
|
return $this->readProjectFile($sourcePath);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return $this->readProjectFile($webPath);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private function usesSharedListFiltersPartial(string $content): bool
|
|
|
|
|
{
|
|
|
|
|
return str_contains($content, "require templatePath('partials/app-list-filters.phtml');");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return list<string>
|
|
|
|
|
*/
|
|
|
|
|
private function hardCutGridEndpointFiles(): array
|
|
|
|
|
{
|
|
|
|
|
return [
|
|
|
|
|
'modules/addressbook/pages/address-book/data().php',
|
|
|
|
|
'pages/search/data().php',
|
|
|
|
|
'pages/admin/users/data().php',
|
|
|
|
|
'pages/admin/tenants/data().php',
|
|
|
|
|
'pages/admin/departments/data().php',
|
|
|
|
|
'pages/admin/roles/data().php',
|
|
|
|
|
'pages/admin/permissions/data().php',
|
|
|
|
|
'pages/admin/mail-log/data().php',
|
|
|
|
|
'pages/admin/scheduled-jobs/data().php',
|
|
|
|
|
'pages/admin/scheduled-jobs/runs-data($id).php',
|
refactor(audit): extract audit domain into self-contained module
Move the entire audit subsystem (system audit, API audit, import audit,
user lifecycle audit, frontend telemetry) from core into modules/audit/.
Core decoupling via interface-based injection:
- AuditRecorderInterface replaces SystemAuditService in 10+ core services
- UserLifecycleAuditInterface / ImportAuditInterface for specialized flows
- NullAuditRecorder fallback when audit module is disabled
- ApiBootstrap/ApiResponse use null-safe callable resolvers
Module structure (modules/audit/):
- Manifest with routes, permissions, scheduler jobs, authorization policy
- 9 services, 8 repositories, 6 domain enums, 4 job handlers
- 33 page files, 4 JS files, 8 test files, migration scripts, i18n
Core cleanup:
- OperationsAuthorizationPolicy, UiCapabilityMap, PermissionService
surgically cleaned of audit-specific constants
- Sidebar template cleared of hardcoded audit navigation
- AuditModuleIsolationContractTest ensures no future core→module coupling
All quality gates pass: 1346 tests (19,276 assertions), PHPStan level 5
clean, architecture contracts verified.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 21:12:49 +01:00
|
|
|
'modules/audit/pages/admin/api-audit/data().php',
|
|
|
|
|
'modules/audit/pages/admin/import-audit/data().php',
|
|
|
|
|
'modules/audit/pages/admin/user-lifecycle-audit/data().php',
|
|
|
|
|
'modules/audit/pages/admin/system-audit/data().php',
|
2026-03-19 18:25:19 +01:00
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return array<string,string>
|
|
|
|
|
*/
|
|
|
|
|
private function hardCutGridEndpointSchemaFiles(): array
|
|
|
|
|
{
|
|
|
|
|
return [
|
|
|
|
|
'modules/addressbook/pages/address-book/data().php' => "gridParseFiltersFromSchemaFile(__DIR__ . '/filter-schema.php'",
|
|
|
|
|
'pages/search/data().php' => "gridParseFiltersFromSchemaFile(__DIR__ . '/filter-schema.php'",
|
|
|
|
|
'pages/admin/users/data().php' => "gridParseFiltersFromSchemaFile(__DIR__ . '/filter-schema.php'",
|
|
|
|
|
'pages/admin/tenants/data().php' => "gridParseFiltersFromSchemaFile(__DIR__ . '/filter-schema.php'",
|
|
|
|
|
'pages/admin/departments/data().php' => "gridParseFiltersFromSchemaFile(__DIR__ . '/filter-schema.php'",
|
|
|
|
|
'pages/admin/roles/data().php' => "gridParseFiltersFromSchemaFile(__DIR__ . '/filter-schema.php'",
|
|
|
|
|
'pages/admin/permissions/data().php' => "gridParseFiltersFromSchemaFile(__DIR__ . '/filter-schema.php'",
|
|
|
|
|
'pages/admin/mail-log/data().php' => "gridParseFiltersFromSchemaFile(__DIR__ . '/filter-schema.php'",
|
|
|
|
|
'pages/admin/scheduled-jobs/data().php' => "gridParseFiltersFromSchemaFile(__DIR__ . '/filter-schema.php'",
|
|
|
|
|
'pages/admin/scheduled-jobs/runs-data($id).php' => "gridParseFiltersFromSchemaFile(__DIR__ . '/runs-filter-schema.php'",
|
refactor(audit): extract audit domain into self-contained module
Move the entire audit subsystem (system audit, API audit, import audit,
user lifecycle audit, frontend telemetry) from core into modules/audit/.
Core decoupling via interface-based injection:
- AuditRecorderInterface replaces SystemAuditService in 10+ core services
- UserLifecycleAuditInterface / ImportAuditInterface for specialized flows
- NullAuditRecorder fallback when audit module is disabled
- ApiBootstrap/ApiResponse use null-safe callable resolvers
Module structure (modules/audit/):
- Manifest with routes, permissions, scheduler jobs, authorization policy
- 9 services, 8 repositories, 6 domain enums, 4 job handlers
- 33 page files, 4 JS files, 8 test files, migration scripts, i18n
Core cleanup:
- OperationsAuthorizationPolicy, UiCapabilityMap, PermissionService
surgically cleaned of audit-specific constants
- Sidebar template cleared of hardcoded audit navigation
- AuditModuleIsolationContractTest ensures no future core→module coupling
All quality gates pass: 1346 tests (19,276 assertions), PHPStan level 5
clean, architecture contracts verified.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 21:12:49 +01:00
|
|
|
'modules/audit/pages/admin/api-audit/data().php' => "gridParseFiltersFromSchemaFile(__DIR__ . '/filter-schema.php'",
|
|
|
|
|
'modules/audit/pages/admin/import-audit/data().php' => "gridParseFiltersFromSchemaFile(__DIR__ . '/filter-schema.php'",
|
|
|
|
|
'modules/audit/pages/admin/user-lifecycle-audit/data().php' => "gridParseFiltersFromSchemaFile(__DIR__ . '/filter-schema.php'",
|
|
|
|
|
'modules/audit/pages/admin/system-audit/data().php' => "gridParseFiltersFromSchemaFile(__DIR__ . '/filter-schema.php'",
|
2026-03-19 18:25:19 +01:00
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return list<string>
|
|
|
|
|
*/
|
|
|
|
|
private function listIndexTemplates(): array
|
|
|
|
|
{
|
|
|
|
|
return [
|
|
|
|
|
'modules/addressbook/pages/address-book/index(default).phtml',
|
|
|
|
|
'pages/search/index(default).phtml',
|
|
|
|
|
'pages/admin/users/index(default).phtml',
|
|
|
|
|
'pages/admin/tenants/index(default).phtml',
|
|
|
|
|
'pages/admin/departments/index(default).phtml',
|
|
|
|
|
'pages/admin/roles/index(default).phtml',
|
|
|
|
|
'pages/admin/permissions/index(default).phtml',
|
|
|
|
|
'pages/admin/mail-log/index(default).phtml',
|
|
|
|
|
'pages/admin/scheduled-jobs/index(default).phtml',
|
refactor(audit): extract audit domain into self-contained module
Move the entire audit subsystem (system audit, API audit, import audit,
user lifecycle audit, frontend telemetry) from core into modules/audit/.
Core decoupling via interface-based injection:
- AuditRecorderInterface replaces SystemAuditService in 10+ core services
- UserLifecycleAuditInterface / ImportAuditInterface for specialized flows
- NullAuditRecorder fallback when audit module is disabled
- ApiBootstrap/ApiResponse use null-safe callable resolvers
Module structure (modules/audit/):
- Manifest with routes, permissions, scheduler jobs, authorization policy
- 9 services, 8 repositories, 6 domain enums, 4 job handlers
- 33 page files, 4 JS files, 8 test files, migration scripts, i18n
Core cleanup:
- OperationsAuthorizationPolicy, UiCapabilityMap, PermissionService
surgically cleaned of audit-specific constants
- Sidebar template cleared of hardcoded audit navigation
- AuditModuleIsolationContractTest ensures no future core→module coupling
All quality gates pass: 1346 tests (19,276 assertions), PHPStan level 5
clean, architecture contracts verified.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 21:12:49 +01:00
|
|
|
'modules/audit/pages/admin/api-audit/index(default).phtml',
|
|
|
|
|
'modules/audit/pages/admin/import-audit/index(default).phtml',
|
|
|
|
|
'modules/audit/pages/admin/user-lifecycle-audit/index(default).phtml',
|
|
|
|
|
'modules/audit/pages/admin/system-audit/index(default).phtml',
|
2026-03-19 18:25:19 +01:00
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return list<string>
|
|
|
|
|
*/
|
|
|
|
|
private function listIndexActions(): array
|
|
|
|
|
{
|
|
|
|
|
return [
|
|
|
|
|
'modules/addressbook/pages/address-book/index().php',
|
|
|
|
|
'pages/search/index().php',
|
|
|
|
|
'pages/admin/users/index().php',
|
|
|
|
|
'pages/admin/tenants/index().php',
|
|
|
|
|
'pages/admin/departments/index().php',
|
|
|
|
|
'pages/admin/roles/index().php',
|
|
|
|
|
'pages/admin/permissions/index().php',
|
|
|
|
|
'pages/admin/mail-log/index().php',
|
|
|
|
|
'pages/admin/scheduled-jobs/index().php',
|
refactor(audit): extract audit domain into self-contained module
Move the entire audit subsystem (system audit, API audit, import audit,
user lifecycle audit, frontend telemetry) from core into modules/audit/.
Core decoupling via interface-based injection:
- AuditRecorderInterface replaces SystemAuditService in 10+ core services
- UserLifecycleAuditInterface / ImportAuditInterface for specialized flows
- NullAuditRecorder fallback when audit module is disabled
- ApiBootstrap/ApiResponse use null-safe callable resolvers
Module structure (modules/audit/):
- Manifest with routes, permissions, scheduler jobs, authorization policy
- 9 services, 8 repositories, 6 domain enums, 4 job handlers
- 33 page files, 4 JS files, 8 test files, migration scripts, i18n
Core cleanup:
- OperationsAuthorizationPolicy, UiCapabilityMap, PermissionService
surgically cleaned of audit-specific constants
- Sidebar template cleared of hardcoded audit navigation
- AuditModuleIsolationContractTest ensures no future core→module coupling
All quality gates pass: 1346 tests (19,276 assertions), PHPStan level 5
clean, architecture contracts verified.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 21:12:49 +01:00
|
|
|
'modules/audit/pages/admin/api-audit/index().php',
|
|
|
|
|
'modules/audit/pages/admin/import-audit/index().php',
|
|
|
|
|
'modules/audit/pages/admin/user-lifecycle-audit/index().php',
|
|
|
|
|
'modules/audit/pages/admin/system-audit/index().php',
|
2026-03-19 18:25:19 +01:00
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return list<string>
|
|
|
|
|
*/
|
|
|
|
|
private function drawerListTemplates(): array
|
|
|
|
|
{
|
|
|
|
|
return [
|
|
|
|
|
'modules/addressbook/pages/address-book/index(default).phtml',
|
|
|
|
|
'pages/admin/users/index(default).phtml',
|
|
|
|
|
'pages/admin/tenants/index(default).phtml',
|
|
|
|
|
'pages/admin/departments/index(default).phtml',
|
|
|
|
|
'pages/admin/roles/index(default).phtml',
|
|
|
|
|
'pages/admin/permissions/index(default).phtml',
|
|
|
|
|
'pages/admin/mail-log/index(default).phtml',
|
|
|
|
|
'pages/admin/scheduled-jobs/index(default).phtml',
|
refactor(audit): extract audit domain into self-contained module
Move the entire audit subsystem (system audit, API audit, import audit,
user lifecycle audit, frontend telemetry) from core into modules/audit/.
Core decoupling via interface-based injection:
- AuditRecorderInterface replaces SystemAuditService in 10+ core services
- UserLifecycleAuditInterface / ImportAuditInterface for specialized flows
- NullAuditRecorder fallback when audit module is disabled
- ApiBootstrap/ApiResponse use null-safe callable resolvers
Module structure (modules/audit/):
- Manifest with routes, permissions, scheduler jobs, authorization policy
- 9 services, 8 repositories, 6 domain enums, 4 job handlers
- 33 page files, 4 JS files, 8 test files, migration scripts, i18n
Core cleanup:
- OperationsAuthorizationPolicy, UiCapabilityMap, PermissionService
surgically cleaned of audit-specific constants
- Sidebar template cleared of hardcoded audit navigation
- AuditModuleIsolationContractTest ensures no future core→module coupling
All quality gates pass: 1346 tests (19,276 assertions), PHPStan level 5
clean, architecture contracts verified.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 21:12:49 +01:00
|
|
|
'modules/audit/pages/admin/api-audit/index(default).phtml',
|
|
|
|
|
'modules/audit/pages/admin/import-audit/index(default).phtml',
|
|
|
|
|
'modules/audit/pages/admin/user-lifecycle-audit/index(default).phtml',
|
|
|
|
|
'modules/audit/pages/admin/system-audit/index(default).phtml',
|
2026-03-19 18:25:19 +01:00
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return list<string>
|
|
|
|
|
*/
|
|
|
|
|
private function searchOnlyTemplates(): array
|
|
|
|
|
{
|
|
|
|
|
return [
|
|
|
|
|
'pages/search/index(default).phtml',
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
}
|