diff --git a/CHANGELOG.md b/CHANGELOG.md index ca17bb9..791899b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,11 +5,15 @@ Intended to follow [«Keep a Changelog»](https://keepachangelog.com/en/) ---- +## TODO +- TODO: remove variableUnpredictable` in favour of `variableUninferable` + ## Upcoming ### Added - Support for attributes * missing stand-alone attribute ??? +- Extended test case for Loophole (still failing) ### Removed * Support for PHP < 7.4 diff --git a/tests/AttribForceFactoryRuleTest.php b/tests/AttribForceFactoryRuleTest.php index 018a56e..379c5c2 100644 --- a/tests/AttribForceFactoryRuleTest.php +++ b/tests/AttribForceFactoryRuleTest.php @@ -22,6 +22,12 @@ public function testLoopholeFactory(): void $this->analyse([__DIR__ . '/dataAttrib/LoopholeFactory.php'], []); } + // Sadly this remains a vector, as phpstan fails to infer the created class name + public function testLoopholeInvoker(): void + { + $this->analyse([__DIR__ . '/dataAttrib/LoopholeFactory.php', __DIR__ . '/dataAttrib/LoopholeInvoker.php'], []); + } + public function testEmptyAllowedClasses(): void { $this->analyse([__DIR__ . '/dataAttrib/EmptyFactory.php'], [ diff --git a/tests/dataAttrib/LoopholeInvoker.php b/tests/dataAttrib/LoopholeInvoker.php new file mode 100644 index 0000000..f4d708c --- /dev/null +++ b/tests/dataAttrib/LoopholeInvoker.php @@ -0,0 +1,27 @@ +loopholeFactory = new LoopholeFactory(); + } + + public function expectedFailingLoophole(): object + { + $loophole = $this->loopholeFactory->variableUninferable(true); + + return $loophole; + } + + public function expectedMissingClass() + { + return $this->loopholeFactory->variableUninferable(false); + } +}