2026-07-24 17:19:56 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
describe('coding standards', function (): void {
|
|
|
|
|
arch()->preset()->php();
|
|
|
|
|
arch()->preset()->security();
|
|
|
|
|
|
2026-09-20 17:16:15 +02:00
|
|
|
arch('all source files use strict types')
|
|
|
|
|
->expect(['Application', 'Domain', 'Shared'])
|
|
|
|
|
->toUseStrictTypes();
|
2026-07-24 17:19:56 +02:00
|
|
|
|
2026-09-20 17:16:15 +02:00
|
|
|
arch('no sleep functions in production code')
|
2026-07-24 17:19:56 +02:00
|
|
|
->expect(['sleep', 'usleep'])
|
|
|
|
|
->not->toBeUsed();
|
|
|
|
|
|
2026-09-20 17:16:15 +02:00
|
|
|
arch('no singletons in production code')
|
|
|
|
|
->expect(['getInstance', 'instance'])
|
2026-07-24 17:19:56 +02:00
|
|
|
->not->toBeUsed();
|
|
|
|
|
|
2026-09-20 17:16:15 +02:00
|
|
|
arch('no direct filesystem writes in domain or application')
|
|
|
|
|
->expect(['Application', 'Domain'])
|
|
|
|
|
->not->toUse(['file_put_contents', 'fopen']);
|
2026-07-24 17:19:56 +02:00
|
|
|
});
|