phpstan-todo-by
phpstan-todo-by copied to clipboard
Deprecations that I trigger myself are reported
Hi,
first up: really great library! Thanks for all your hard work, much appreciated.
So I have this code in my library:
if (!$this->strictIds)
{
trigger_deprecation("...", "3.2.2", "Not setting strictIds when configuring the page tree is deprecated.");
}
But this gets reported when running PHPStan in this library:
------ --------------------------------------------------------------------------------------------------
Line src/PageTree/Builder/PageTreeConfig.php
------ --------------------------------------------------------------------------------------------------
47 Since ... 3.2.2: Not setting strictIds when configuring the page tree is deprecated..
🪪 todoBy.sfDeprecation
✏️ src/PageTree/Builder/PageTreeConfig.php
------ --------------------------------------------------------------------------------------------------
To be clear: that is not another code block that calls my code, but just the definition / triggering of a deprecation that gets reported.
could you provide a full repro?
wheter a call to trigger_deprecation triggers a phpstan error depends on all the given arguments and additionally depends on your composer.json version constraints
I have a repro, however while it's a fairly small library, it is not minimal.
But here goes:
- Checkout https://github.com/21TORR/RadBundle
composer up && composer bin all upcomposer test
Should be green.
Now go to the ApiResponse and remove the lines https://github.com/21TORR/RadBundle/blob/3.x/src/Api/ApiResponse.php#L24 and line 38.
Rerun composer test.
I now get two issues:
Hope that helps