Skip to content

Commit

Permalink
Remove debug artifacts and fix code
Browse files Browse the repository at this point in the history
PHPStan yells at
`Attribute class INVALID\NOT\FOUND\ATTRIBUTE does not exist.`
  • Loading branch information
ebln committed Jun 7, 2024
1 parent fbcb705 commit 1d4e513
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 14 deletions.
9 changes: 0 additions & 9 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,3 @@ parameters:
paths:
- src
- tests

excludePaths:
analyseAndScan:
- tests/data/*
- tests/dataAttrib/*
- tests/dataMixed/*

rules:
- \Ebln\PHPStan\EnforceFactory\ForceFactoryRule
4 changes: 2 additions & 2 deletions tests/dataAttrib/LoopholeFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@

class LoopholeFactory
{
public function variableUninferable(bool $toggle): void
public function variableUninferable(bool $toggle): object
{
if ($toggle) {
$class = '\Test\Ebln\PHPStan\EnforceFactory\dataAttrib\code\LoopholeProduct';
} else {
$class = 'Hello world-' . random_int(10, 99);
}

$new = new $class();
return new $class();
}
}
4 changes: 2 additions & 2 deletions tests/dataAttrib/LoopholeInvoker.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
1 change: 0 additions & 1 deletion tests/dataAttrib/code/IndependentForcedFactoryProduct.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use Test\Ebln\PHPStan\EnforceFactory\dataAttrib\IndependentFactory;

#[\Ebln\Attrib\ForceFactory(IndependentFactory::class)]
#[\INVALID\NOT\FOUND\ATTRIBUTE(IndependentFactory::class)]
class IndependentForcedFactoryProduct
{
}

0 comments on commit 1d4e513

Please sign in to comment.