Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit fd140fc

Browse filesBrowse files
committed
minor #16691 [DI] remove useless condition around unset (Tobion)
This PR was merged into the 2.3 branch. Discussion ---------- [DI] remove useless condition around unset | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a Commits ------- 478375d [DI] remove useless condition around unset
2 parents 5f93188 + 478375d commit fd140fc
Copy full SHA for fd140fc

File tree

Expand file treeCollapse file tree

2 files changed

+2
-7
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+2
-7
lines changed

‎src/Symfony/Component/DependencyInjection/Container.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Container.php
+1-4Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -312,10 +312,7 @@ public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE
312312
$service = $this->$method();
313313
} catch (\Exception $e) {
314314
unset($this->loading[$id]);
315-
316-
if (array_key_exists($id, $this->services)) {
317-
unset($this->services[$id]);
318-
}
315+
unset($this->services[$id]);
319316

320317
if ($e instanceof InactiveScopeException && self::EXCEPTION_ON_INVALID_REFERENCE !== $invalidBehavior) {
321318
return;

‎src/Symfony/Component/DependencyInjection/Definition.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Definition.php
+1-3Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -409,9 +409,7 @@ public function hasTag($name)
409409
*/
410410
public function clearTag($name)
411411
{
412-
if (isset($this->tags[$name])) {
413-
unset($this->tags[$name]);
414-
}
412+
unset($this->tags[$name]);
415413

416414
return $this;
417415
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.