diff --git a/phpstan.neon b/phpstan.neon index 2e7645a..6699c65 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -6,12 +6,3 @@ parameters: paths: - src - tests - - excludePaths: - analyseAndScan: - - tests/data/* - - tests/dataAttrib/* - - tests/dataMixed/* - -rules: - - \Ebln\PHPStan\EnforceFactory\ForceFactoryRule diff --git a/tests/dataAttrib/LoopholeFactory.php b/tests/dataAttrib/LoopholeFactory.php index 912c0cf..b41f714 100644 --- a/tests/dataAttrib/LoopholeFactory.php +++ b/tests/dataAttrib/LoopholeFactory.php @@ -6,7 +6,7 @@ class LoopholeFactory { - public function variableUninferable(bool $toggle): void + public function variableUninferable(bool $toggle): object { if ($toggle) { $class = '\Test\Ebln\PHPStan\EnforceFactory\dataAttrib\code\LoopholeProduct'; @@ -14,6 +14,6 @@ public function variableUninferable(bool $toggle): void $class = 'Hello world-' . random_int(10, 99); } - $new = new $class(); + return new $class(); } } diff --git a/tests/dataAttrib/LoopholeInvoker.php b/tests/dataAttrib/LoopholeInvoker.php index f4d708c..fff9c91 100644 --- a/tests/dataAttrib/LoopholeInvoker.php +++ b/tests/dataAttrib/LoopholeInvoker.php @@ -20,8 +20,8 @@ public function expectedFailingLoophole(): object return $loophole; } - public function expectedMissingClass() + public function expectedMissingClass(): void { - return $this->loopholeFactory->variableUninferable(false); + $this->loopholeFactory->variableUninferable(false); } } diff --git a/tests/dataAttrib/code/IndependentForcedFactoryProduct.php b/tests/dataAttrib/code/IndependentForcedFactoryProduct.php index 9a7acf7..a125fa8 100644 --- a/tests/dataAttrib/code/IndependentForcedFactoryProduct.php +++ b/tests/dataAttrib/code/IndependentForcedFactoryProduct.php @@ -7,7 +7,6 @@ use Test\Ebln\PHPStan\EnforceFactory\dataAttrib\IndependentFactory; #[\Ebln\Attrib\ForceFactory(IndependentFactory::class)] -#[\INVALID\NOT\FOUND\ATTRIBUTE(IndependentFactory::class)] class IndependentForcedFactoryProduct { }