8000 [DI] Allow getting synthetic before compilation by ro0NL · Pull Request #19715 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[DI] Allow getting synthetic before compilation #19715

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

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
allow synthetic before compilation
  • Loading branch information
ro0NL committed Aug 23, 2016
commit bf412ebb881aaf93f7cb7ac6c5914849ddfaf69c
Original file line number Diff line number Diff line change
Expand Up @@ -401,10 +401,6 @@ public function has($id)
*/
public function get($id, $invalidBehavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE)
{
if (!$this->compiled) {
@trigger_error(sprintf('Calling %s() before compiling the container is deprecated since version 3.2 and will throw an exception in 4.0.', __METHOD__), E_USER_DEPRECATED);
}

$id = strtolower($id);

if ($service = parent::get($id, ContainerInterface::NULL_ON_INVALID_REFERENCE)) {
Expand All @@ -415,6 +411,10 @@ public function get($id, $invalidBehavior = ContainerInterface::EXCEPTION_ON_INV
return $this->get($this->aliasDefinitions[$id]);
}

if (!$this->compiled) {
@trigger_error(sprintf('Calling %s() before compiling the container is deprecated for non-synthetic services since version 3.2 and will throw an exception in 4.0.', __METHOD__), E_USER_DEPRECATED);
}

try {
$definition = $this->getDefinition($id);
} catch (ServiceNotFoundException $e) {
Expand Down
0