Skip to content

Commit e17e60e

Browse files
committed
replace phinal with phpat
1 parent b126583 commit e17e60e

File tree

6 files changed

+92
-61
lines changed

6 files changed

+92
-61
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@
3737
},
3838
"require-dev": {
3939
"ext-pdo_sqlite": "~8.2.0 || ~8.3.0 || ~8.4.0",
40-
"cspray/phinal": "dev-main#9826c3407056a4618f8bba303800403e47ccb3a7",
4140
"doctrine/orm": "^2.18.0|^3.0.0",
4241
"infection/infection": "^0.29.10",
4342
"league/commonmark": "^2.4",
4443
"patchlevel/coding-standard": "^1.3.0",
4544
"patchlevel/event-sourcing-psalm-plugin": "^3.1.0",
45+
"phpat/phpat": "^0.11.3",
4646
"phpbench/phpbench": "^1.2.15",
4747
"phpspec/prophecy-phpunit": "^2.1.0",
4848
"phpstan/phpstan": "^2.1.0",

composer.lock

Lines changed: 58 additions & 57 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

phpstan.neon.dist

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
includes:
22
- phpstan-baseline.neon
3+
- vendor/phpat/phpat/extension.neon
34

45
parameters:
56
level: max
67
paths:
78
- src
9+
- tests/Architecture
810
ignoreErrors:
911
-
1012
identifier: missingType.generics
13+
14+
services:
15+
-
16+
class: Patchlevel\EventSourcing\Tests\Architecture\FinalClassesTest
17+
tags:
18+
- phpat.test

psalm.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,5 @@
2020
<plugins>
2121
<pluginClass class="Patchlevel\EventSourcingPsalmPlugin\Plugin"/>
2222
<pluginClass class="Psalm\PhpUnitPlugin\Plugin"/>
23-
<pluginClass class="Cspray\Phinal\Plugin"/>
2423
</plugins>
2524
</psalm>

src/Attribute/Subscriber.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@
55
namespace Patchlevel\EventSourcing\Attribute;
66

77
use Attribute;
8-
use Cspray\Phinal\AllowInheritance;
98
use Patchlevel\EventSourcing\Subscription\RunMode;
109

1110
#[Attribute(Attribute::TARGET_CLASS)]
12-
#[AllowInheritance('You can create specific attributes with default group and run mode')]
1311
class Subscriber
1412
{
1513
public function __construct(
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
namespace Patchlevel\EventSourcing\Tests\Architecture;
4+
5+
use Patchlevel\EventSourcing\Attribute\Subscriber;
6+
use PHPat\Selector\Selector;
7+
use PHPat\Test\PHPat;
8+
use PHPat\Test\Builder\Rule;
9+
10+
final class FinalClassesTest
11+
{
12+
public function testFinalClasses(): Rule
13+
{
14+
return PHPat::rule()
15+
->classes(
16+
Selector::AllOf(
17+
Selector::inNamespace('Patchlevel\EventSourcing'),
18+
Selector::NOT(Selector::isAbstract()),
19+
Selector::NOT(Selector::isInterface()),
20+
Selector::NOT(Selector::classname(Subscriber::class)),
21+
)
22+
)
23+
->shouldBeFinal();
24+
}
25+
}

0 commit comments

Comments
 (0)