Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Improve return type of getProvidedServices in ServiceProviderInterface #50667

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

Merged
merged 1 commit into from
Jun 23, 2023

Conversation

andersonamuller
Copy link
Contributor

Q A
Branch? 6.4
Bug fix? maybe
New feature? no
Deprecations? no
License MIT

This describes better the shape of the array it returns.

@carsonbot carsonbot added this to the 6.4 milestone Jun 15, 2023
@andersonamuller andersonamuller changed the title Improve return type of getProvidedServices in ServiceProviderInterface Improve return type of getProvidedServices in ServiceProviderInterface Jun 15, 2023
@stof
Copy link
Member

stof commented Jun 21, 2023

To solve the issue reported by psalm for ServiceLocatorTrait, you should also improve the type of its constructor argument to say that its array of callables should be indexed by strings.

@andersonamuller
Copy link
Contributor Author

To solve the issue reported by psalm for ServiceLocatorTrait, you should also improve the type of its constructor argument to say that its array of callables should be indexed by strings.

Yes, indeed, I first wanted to confirm that is a valid change. I will fix the rest when I have more time.

@fabpot
Copy link
Member

fabpot commented Jun 23, 2023

@andersonamuller Can you rebase your PR to get rid of the merge commit? Thank you.

@nicolas-grekas
Copy link
Member

Thank you @andersonamuller.

@nicolas-grekas nicolas-grekas merged commit 27da66b into symfony:6.4 Jun 23, 2023
nicolas-grekas added a commit that referenced this pull request Jul 20, 2023
…iceLocatorTrait` (andersonamuller)

This PR was merged into the 6.4 branch.

Discussion
----------

[DependencyInjection] Improve type of factories in `ServiceLocatorTrait`

| Q             | A
| ------------- | ---
| Branch?       | 6.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | N/A
| License       | MIT
| Doc PR        | N/A

This describes better the shape of the array it expects.

Completing this other PR #50667

Commits
-------

b3d005f Improve type of factories in `ServiceLocatorTrait`
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.

5 participants