Skip to content

Commit

Permalink
merged branch franmomu/reuse_variable_formpass (PR symfony#7464)
Browse files Browse the repository at this point in the history
This PR was merged into the 2.1 branch.

Discussion
----------

[FrameworkBundle] Reuse definition variable in FormPass

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Commits
-------

f52320d [FrameworkBundle] Reuse definition variable in FormPass
  • Loading branch information
fabpot committed Mar 24, 2013
2 parents 8ae7d98 + f52320d commit d9009cb
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ public function process(ContainerBuilder $container)
return;
}

$definition = $container->getDefinition('form.extension');

// Builds an array with service IDs as keys and tag aliases as values
$types = array();

Expand All @@ -40,7 +42,7 @@ public function process(ContainerBuilder $container)
$types[$alias] = $serviceId;
}

$container->getDefinition('form.extension')->replaceArgument(1, $types);
$definition->replaceArgument(1, $types);

$typeExtensions = array();

Expand All @@ -52,11 +54,11 @@ public function process(ContainerBuilder $container)
$typeExtensions[$alias][] = $serviceId;
}

$container->getDefinition('form.extension')->replaceArgument(2, $typeExtensions);
$definition->replaceArgument(2, $typeExtensions);

// Find all services annotated with "form.type_guesser"
$guessers = array_keys($container->findTaggedServiceIds('form.type_guesser'));

$container->getDefinition('form.extension')->replaceArgument(3, $guessers);
$definition->replaceArgument(3, $guessers);
}
}

0 comments on commit d9009cb

Please sign in to comment.