Classes should be final

This commit is contained in:
Oliver Davies 2025-06-25 22:48:42 +01:00
parent 431545bfc4
commit 7dcc7a2126
4 changed files with 95 additions and 1 deletions

View 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();
}
}