expect('Domain\Ports\Directories') ->toHaveSuffix('Directory'); arch('Port Repository interfaces have Repository suffix') ->expect('Domain\Ports\Repositories') ->toHaveSuffix('Repository'); arch('Domain Builders have Builder suffix') ->expect('Domain\Builders') ->toHaveSuffix('Builder'); arch('Domain Exceptions have Exception suffix') ->expect('Domain\Exceptions') ->toHaveSuffix('Exception'); }); describe('Naming Conventions in Application', function (): void { arch('Application Port Directory interfaces have Directory suffix') ->expect('Application\Security\Ports\Directories') ->toHaveSuffix('Directory'); arch('Application Port Repository interfaces have Repository suffix') ->expect('Application\Security\Ports\Repositories') ->toHaveSuffix('Repository'); arch('Application Config classes have Config suffix') ->expect([ 'Application\Arcadia\Config', 'Application\Health\Config', 'Application\Security\Config', ]) ->classes() ->toHaveSuffix('Config') ->ignoring([ DevClientCredentials::class, ]); arch('Application Exception classes have Exception suffix') ->expect([ 'Application\Arcadia\Exceptions', 'Application\Health\Exceptions', 'Application\Security\Exceptions', ]) ->toHaveSuffix('Exception'); }); describe('Naming Conventions in Presentation', function (): void { arch('Controllers have Controller suffix') ->expect([ 'Presentation\Api\V1\Http\Controllers', 'Presentation\Web\Http\Controllers', ]) ->toHaveSuffix('Controller'); arch('Requests extending FormRequest must have Request suffix') ->expect('Presentation\Api\V1\Http\Requests') ->toExtend(FormRequest::class) ->toHaveSuffix('Request'); arch('Responses implementing ApiResponse must have Response suffix') ->expect('Presentation\Api\V1\Http\Responses') ->toImplement(ApiResponse::class) ->toHaveSuffix('Response'); arch('Console Commands extending Command must have Command suffix') ->expect('Presentation\Console\Commands') ->toExtend(Command::class) ->toHaveSuffix('Command'); arch('Classes implementing Presenter must have Presenter suffix') ->expect(Presenter::class) ->classes() ->toHaveSuffix('Presenter') ->ignoring(Presenter::class); }); describe('Naming Conventions in Infra', function (): void { arch('Infra classes extending ServiceProvider must have Provider suffix') ->expect('Infra\Providers') ->toExtend(ServiceProvider::class) ->toHaveSuffix('Provider'); arch('Infra directory adapters implementing Directory port must have Directory suffix') ->expect('Infra\Adapters\Directories') ->toImplement(Directory::class) ->toHaveSuffix('Directory'); arch('Infra repository adapters implementing Repository port must have Repository suffix') ->expect('Infra\Adapters\Repositories') ->toImplement(Repository::class) ->toHaveSuffix('Repository'); arch('Infra Mappers must have Mapper suffix') ->expect('Infra\Adapters\Mappers') ->toHaveSuffix('Mapper'); arch('Infra Parsers must have Parser suffix') ->expect('Infra\Adapters\Parsers') ->toHaveSuffix('Parser'); arch('Infra Casts implementing CastsAttributes must have Cast suffix') ->expect('Infra\Casts') ->toImplement(CastsAttributes::class) ->toHaveSuffix('Cast'); arch('Infra Jobs must have Job suffix') ->expect('Infra\Jobs') ->toHaveSuffix('Job'); });