laminas-servicemanager icon indicating copy to clipboard operation
laminas-servicemanager copied to clipboard

Make code more modern and implement php 7.4 type declarations

Open GeeH opened this issue 4 years ago • 8 comments

[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 avatar Jun 12 '20 11:06 GeeH

@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.

ppaulis avatar Jan 07 '21 07:01 ppaulis

i also could help to improve the PSR-12 Coding Style and Type-Hint.

nusphere avatar Mar 24 '21 07:03 nusphere

@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 avatar Mar 27 '21 13:03 nusphere

@nusphere I'm waiting for some maintainer input here to avoid doing the work at the same time than someone else.

ppaulis avatar Mar 29 '21 12:03 ppaulis

@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.

nusphere avatar Apr 03 '21 13:04 nusphere

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 avatar Jun 07 '21 15:06 GeeH

@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.

boesing avatar Jun 07 '21 16:06 boesing

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.

fabiang avatar Aug 09 '22 07:08 fabiang

Closed with #191

boesing avatar May 10 '23 12:05 boesing