Skip to content
This repository has been archived by the owner on Jun 26, 2018. It is now read-only.

Support class constants for services' names #1

Closed
wants to merge 5 commits into from

Conversation

hectorj
Copy link
Contributor

@hectorj hectorj commented Jul 18, 2017

Hi!

With the newest versions of Symfony, it has become a common practice to use fully qualified class names as services' ids.

So I added support for using class constants like Foo::class as argument to get()

@hectorj
Copy link
Contributor Author

hectorj commented Jul 18, 2017

I have some code style issues + a nullable return type to remove

@lookyman
Copy link
Owner

lookyman commented Jul 18, 2017

Thank you, I'll have a look at it later today. Meanwhile, please check out the failing Travis build.

EDIT: You were 3 seconds faster. :)

* @param mixed $node
* @return null|string
*/
public static function getServiceIdFromNode($node)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not a fan of having this here... but I needed a way to get the ID there : https://github.com/hectorj/phpstan-symfony/blob/ba8dc8d950a5da6117172f1e231fe55b75f34715/src/Rules/ContainerInterfaceUnknownServiceRule.php#L38

I'm open to suggestions.
Don't hesitate to edit the PR if you want to refactor.

@lookyman
Copy link
Owner

lookyman commented Dec 8, 2017

I'm going to pick this up again and get it implemented. Sorry I was MIA..

@lookyman
Copy link
Owner

lookyman commented Dec 8, 2017

Implemented as 57f8fcb. Thank you!

@lookyman lookyman closed this Dec 8, 2017
@hectorj hectorj deleted the class-const branch February 26, 2018 07:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants