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

Compiler::loadDefinitions: allow to get to existing service by class #145

Closed

Conversation

@matej21
Copy link
Contributor

matej21 commented Feb 27, 2017

  • bug fix? no
  • new feature? yes
  • BC break? no

it is useful when you want to modify anonymous service in your local.neon

@matej21 matej21 force-pushed the matej21:feature/config-service-by-class branch from be48786 to 6339d48 Feb 27, 2017
@TomasVotruba

This comment has been minimized.

Copy link
Contributor

TomasVotruba commented Feb 27, 2017

Interesting. What is your specific use case?

@matej21 matej21 force-pushed the matej21:feature/config-service-by-class branch from 6339d48 to b592489 Feb 27, 2017
@dg dg closed this in 4eb358d Feb 27, 2017
dg added a commit that referenced this pull request Feb 27, 2017
dg added a commit that referenced this pull request Mar 8, 2017
@@ -257,7 +257,13 @@ public function generateCode(): array
public static function loadDefinitions(ContainerBuilder $builder, array $services, string $namespace = NULL)
{
foreach ($services as $name => $def) {
if ((string) (int) $name === (string) $name) {
if (is_string($name) && preg_match('#^@\w*[\\\][\w\\\]+\z#', $name)) {

This comment has been minimized.

Copy link
@dg

dg May 2, 2017

Member

What about

if (is_int($name)) {
    ....
} elseif (preg_match(....)) {
   ....
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.