Classes should be final
This commit is contained in:
parent
431545bfc4
commit
7dcc7a2126
4 changed files with 95 additions and 1 deletions
25
tools/Phpat/ArchitectureTest.php
Normal file
25
tools/Phpat/ArchitectureTest.php
Normal file
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Tools\Phpat;
|
||||
|
||||
use PHPat\Selector\Selector;
|
||||
use PHPat\Test\Builder\Rule;
|
||||
use PHPat\Test\PHPat;
|
||||
|
||||
final class ArchitectureTest {
|
||||
|
||||
public function test_classes_should_be_final(): Rule {
|
||||
return PHPat::rule()
|
||||
->classes(
|
||||
Selector::inNamespace(
|
||||
namespace: '/^Drupal\\\\opd_\w+/',
|
||||
regex: TRUE,
|
||||
),
|
||||
)
|
||||
->excluding(Selector::isInterface())
|
||||
->shouldBeFinal();
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue