laminas-servicemanager
laminas-servicemanager copied to clipboard
Make code more modern and implement php 7.4 type declarations
[x] add declare(strict_types=1)
to all src and test files
[x] add parameter type declarations where appropriate
[x] add return type declarations where appropriate
[ ] add property types
[ ] update code style to PSR-12
[ ] Update composer dependencies including PHPUnit to modern versions
[ ] rejoice in a job well done
@GeeH need some help on this? I took a quick look at the dependencies. Not everything seems to be PHP8-ready yet, but I could help with the PSR-12 and the property types in the meantime.
i also could help to improve the PSR-12 Coding Style and Type-Hint.
@GeeH @ppaulis is there currently someone who is actively working on it?
is it possible that I can divide myself into it? Because doing something twice is more or less pointless. But since the issue has not been further developed since June 18th ... what is the current status? or does it make sense to simply fork the current 4.0.0 branch and off you go?
@nusphere I'm waiting for some maintainer input here to avoid doing the work at the same time than someone else.
@ppaulis
Thank you for your feedback. in the meantime i have tried other components, as there is basically a lot to do.
Doing double the job makes absolutely no sense.
I am happy to help with this task, but I am now trying to create the basis for such a refactoring by helping to provide the GitHub Actions in the components.
Hi, huge apologies, real life took over. I'm happy to get back involved here but would you be able to roundup what you need from me please @nusphere ?
@GeeH In the meantime, we dropped v4.0.0 as having a new major version in the service manager would lead to a huge amount of work in almost every other component which works with the servicemanager directly (e.g. due to the usage of AbstractPluginManager
).
Another thing is a proper migration path for the psr/container
BC break.
Thus said, I don't think it makes sense to approach type-safety or PHP 7.4 type declarations without having a proper strategy on how we want to proceed with this component.
Just a side note for the one who will implement this, the return-type of Laminas\ServiceManager\Factory\FactoryInterface::__invoke()
is currently declared as @return object
, but even in real-world application __invoke()
could return everything (even scalars).
So mixed
is the correct return-type here. One example is Laminas\Mvc\Service\ConfigFactory::__invoke()
which returns iterable
.
Closed with #191