expect('Domain\Models\Entities') ->toImplement(Entity::class); arch('Domain Entities are final and readonly') ->expect('Domain\Models\Entities') ->toBeReadonly() ->toBeFinal(); arch('Domain Ports contain only interfaces') ->expect('Domain\Ports') ->classes() ->toBeInterface(); arch('Domain Port Directories extend Shared\DDD\Directory') ->expect('Domain\Ports\Directories') ->toExtend(Directory::class); arch('Domain Port Repositories extend Shared\DDD\Repository') ->expect('Domain\Ports\Repositories') ->toExtend(Repository::class); arch('Domain does not depend on Application, Presentation, Infra, or App') ->expect('Domain') ->not->toUse([ 'Application', 'Presentation', 'Infra', 'Infrastructure', 'App', ]); arch('Domain does not depend on Illuminate or Symfony frameworks') ->expect('Domain') ->not->toUse([ 'Illuminate', 'Symfony', ]); arch('Domain Value Objects are readonly') ->expect('Domain\Models\ValueObjects') ->classes() ->toBeReadonly(); arch('Domain exceptions extend native DomainException') ->expect('Domain\Exceptions') ->toExtend(\DomainException::class); arch('Domain does not use Laravel helper functions') ->expect('Domain') ->not->toUse([ 'abort', 'app', 'auth', 'asset', 'back', 'bcrypt', 'broadcast', 'cache', 'config', 'cookie', 'csrf_token', 'dd', 'dump', 'decrypt', 'dispatch', 'event', 'factory', 'logger', 'redirect', 'request', 'response', 'route', 'session', 'storage', 'url', 'throw_if', 'throw_unless', '__', 'trans', 'trans_choice', 'view', ]); });