Open thomasvargiu opened 5 years ago
I've added phpstan in CI build and fixed some wrong uses of array_key_exists
with ArrayObject
.
@thomasvargiu I've just noticed that this targets master
: can you change it to develop
? Since it's an improvement, it needs to target the next minor or major.
Please rebase, don't merge :)
My fault, I'm still working on it
@Ocramius I have just one issue that I want to fix:
------ ----------------------------------------------------------------------------------------------------------------------------
Line src/AbstractPluginManager.php
------ ----------------------------------------------------------------------------------------------------------------------------
130 Parameter #1 $instance of method Zend\ServiceManager\AbstractPluginManager::validate() expects object, array|object given.
------ ----------------------------------------------------------------------------------------------------------------------------
I think we should change PHPDoc of $instance
parameter in Zend\ServiceManager\PluginManagerInterface::validate()
from object
to mixed
because we know that services
config key can contain anything.
But I'm not sure about this change. We can also ignore the error at the moment.
What do you think about it?
I've noted that phpstan should only be added for Travis jobs that require it, not as a general dev dependency.
Done.
Additionally, I'll note that a large number of the changes presented here are present in other pull requests; you'll likely need to rebase and run again once those are in place.
It's not a problem, when I open it I though that it could be useful before to introduce strict type hints. We can merge other PRs and then rebase it.
Rescheduling to 4.0.0 since it targets develop in turn targeting 4.0
@weierophinney I rebased it, updated phpstan, done some other fixes.
I also allowed array
in the PluginManager validate()
method.
This repository has been closed and moved to laminas/laminas-servicemanager; a new issue has been opened at https://github.com/laminas/laminas-servicemanager/issues/7.
This repository has been moved to laminas/laminas-servicemanager. If you feel that this patch is still relevant, please re-open against that repository, and reference this issue. To re-open, we suggest the following workflow:
git rebase -i origin/{branch}
)
This PR fixes some issues with phpdoc and types. Used phpstan to static analyse the code.
Added
phpstan
in CI build.