Skip to content

Commit 1d4e513

Browse files
committed
Remove debug artifacts and fix code
PHPStan yells at `Attribute class INVALID\NOT\FOUND\ATTRIBUTE does not exist.`
1 parent fbcb705 commit 1d4e513

File tree

4 files changed

+4
-14
lines changed

4 files changed

+4
-14
lines changed

phpstan.neon

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,3 @@ parameters:
66
paths:
77
- src
88
- tests
9-
10-
excludePaths:
11-
analyseAndScan:
12-
- tests/data/*
13-
- tests/dataAttrib/*
14-
- tests/dataMixed/*
15-
16-
rules:
17-
- \Ebln\PHPStan\EnforceFactory\ForceFactoryRule

tests/dataAttrib/LoopholeFactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66

77
class LoopholeFactory
88
{
9-
public function variableUninferable(bool $toggle): void
9+
public function variableUninferable(bool $toggle): object
1010
{
1111
if ($toggle) {
1212
$class = '\Test\Ebln\PHPStan\EnforceFactory\dataAttrib\code\LoopholeProduct';
1313
} else {
1414
$class = 'Hello world-' . random_int(10, 99);
1515
}
1616

17-
$new = new $class();
17+
return new $class();
1818
}
1919
}

tests/dataAttrib/LoopholeInvoker.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ public function expectedFailingLoophole(): object
2020
return $loophole;
2121
}
2222

23-
public function expectedMissingClass()
23+
public function expectedMissingClass(): void
2424
{
25-
return $this->loopholeFactory->variableUninferable(false);
25+
$this->loopholeFactory->variableUninferable(false);
2626
}
2727
}

tests/dataAttrib/code/IndependentForcedFactoryProduct.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
use Test\Ebln\PHPStan\EnforceFactory\dataAttrib\IndependentFactory;
88

99
#[\Ebln\Attrib\ForceFactory(IndependentFactory::class)]
10-
#[\INVALID\NOT\FOUND\ATTRIBUTE(IndependentFactory::class)]
1110
class IndependentForcedFactoryProduct
1211
{
1312
}

0 commit comments

Comments
 (0)