Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make ServiceLocatorInterface#get() generic #230

Merged
merged 4 commits into from
Apr 3, 2024

Conversation

InvisibleSmiley
Copy link

@InvisibleSmiley InvisibleSmiley commented Mar 13, 2024

Q A
Documentation no
Bugfix no
BC Break no
New Feature yes
RFC no
QA no

Description

Fix #228: Override/improve ContainerInterface::get return type hints in ServiceLocatorInterface (add generics / let class-string input affect return type inference)

Copy link
Member

@boesing boesing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
Could you please add a static analysis test in test/StaticAnalysis to verify that psalm is able to infer the return value as expected?

jhatlak added 2 commits March 22, 2024 12:42
Signed-off-by: Jens Hatlak <[email protected]>
Allow PHPStan to understand conditional returns

Signed-off-by: Jens Hatlak <[email protected]>
Copy link
Member

@Ocramius Ocramius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good! 🚢

@Ocramius Ocramius self-assigned this Apr 3, 2024
@Ocramius Ocramius changed the title Make ServiceLocatorInterface::get generic Make ServiceLocatorInterface#get() generic Apr 3, 2024
@Ocramius Ocramius merged commit ae01570 into laminas:4.1.x Apr 3, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Override/improve ContainerInterface::get return type hints in ServiceLocatorInterface (generics, class-string)
4 participants