Closed korsarNek closed 4 years ago
please do a pull request to change the UrlGeneratorInterface phpdoc (and try it out in your project to be sure it works correctly). i am not sure how well phpstan solves such disagreements between phpdoc for the same method, but i guess it should work.
I've created the pull request, unfortunately PHPStan can not handle merging of PHPDocs, so I copied the PHPDoc from the UrlGeneratorInterface and modified it a bit.
i fixed this in #252
symfony-cmf/routing 2.1.0
Problem
The ChainRouter::generate function uses inheritdoc for the base PHPDoc, but UrlGeneratorInterace::generate says that name must be a string. While with ChainRouter::generate it could be anything.
That is a problem if tools are used that check the PHPDoc types too to validate code, like PHPStan.
Steps to reproduce
I don't have an example project right now, but having a project with PHPStan enabled and using the ChainRouter::generate function from anywhere should show the same error.
Expected results
The ChainRouter::generate function should change the $name parameter type to mixed.
Actual results
PHPStan shows this error:
The eZ\Publish ChainRouter itself has no PHPDoc, it is taken from the UrlGeneratorInterface.