mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-05 20:57:12 +00:00
Specifications should be final
This commit is contained in:
parent
66ee0bd53d
commit
92b3e63759
1 changed files with 7 additions and 0 deletions
|
|
@ -6,6 +6,7 @@ use Arkitect\ClassSet;
|
|||
use Arkitect\CLI\Config;
|
||||
use Arkitect\Expression\ForClasses\Extend;
|
||||
use Arkitect\Expression\ForClasses\HaveNameMatching;
|
||||
use Arkitect\Expression\ForClasses\IsFinal;
|
||||
use Arkitect\Expression\ForClasses\NotDependsOnTheseNamespaces;
|
||||
use Arkitect\Expression\ForClasses\ResideInOneOfTheseNamespaces;
|
||||
use Arkitect\Rules\Rule;
|
||||
|
|
@ -29,5 +30,11 @@ return static function (Config $config): void
|
|||
->because('This is a convention from PHPSpec')
|
||||
;
|
||||
|
||||
$rules[] = Rule::allClasses()
|
||||
->that(new Extend(ObjectBehavior::class))
|
||||
->should(new IsFinal())
|
||||
->because('Specifications should not be extendable')
|
||||
;
|
||||
|
||||
$config->add($srcClassSet, ...$rules);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue