Skip to content

Conversation

lulco
Copy link

@lulco lulco commented Mar 15, 2021

The same problem is with deprecated constant defined in interface and used via subclass.

See e.g. https://github.com/nette/application/blob/v2.4/src/Application/IRouter.php#L22 used with SimpleRouter:

Code \Nette\Application\Routers\SimpleRouter::SECURED throws no error

@lulco lulco changed the title Usage of deprecated constant via subclass is not marked as deprecation call Failing test case - Usage of deprecated constant via subclass is not marked as deprecation call Mar 15, 2021
@ondrejmirtes
Copy link
Member

Hi, I don't get it, you just changed some tests but the tests are passing? Either fix the code, or provide a failing test with expected results...

@lulco
Copy link
Author

lulco commented Mar 15, 2021

Hi, sorry, it is failing on my env. I have to find differencies. First is my php version 7.4.14

@lulco
Copy link
Author

lulco commented Mar 15, 2021

Hi, I can't isolate the problem in this repository for unknown reason, so I've created very simple app to reproduce my problem. If you will have some time, please check it on https://github.com/lulco/deprecated-constant

It is simple Nette 2.4 "application" with RouterFactory where deprecated flag IRouter::SECURED is used. Once directly via IRouter and once via class SimpleRouter (which implements IRouter).

I believe there should be two errors (on lines 15 and 16) in build:
https://github.com/lulco/deprecated-constant/runs/2116992714

@ondrejmirtes
Copy link
Member

Fixed in PHPStan: phpstan/phpstan-src@6d52302

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants