-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DI] Add logging and better failure recovery to AutowirePass #22095
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
Conversation
👍 |
$currentId = $this->currentId; | ||
$this->currentId = $argumentId = sprintf('autowired.%s', $typeHint->name); | ||
|
||
$argumentDefinition = $this->container->register($argumentId, $typeHint->name); | ||
$this->currentDefinition = $argumentDefinition = (new Definition($typeHint->name)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
braces are useless
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
$this->processValue($argumentDefinition, true); | ||
$this->container->setDefinition($argumentId, $argumentDefinition); | ||
} catch (RuntimeException $e) { | ||
// revert any changes done to our internal state |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we have tests covering this ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test case added
e8b87b1
to
3e297ba
Compare
Thank you @nicolas-grekas. |
…rePass (nicolas-grekas) This PR was merged into the 3.3-dev branch. Discussion ---------- [DI] Add logging and better failure recovery to AutowirePass | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - So useful to understand what autowiring is doing. Commits ------- 3e297ba [DI] Add logging and better failure recovery to AutowirePass
So useful to understand what autowiring is doing.