Skip to content

Commit a6eca66

Browse files
committed
minor #19617 Use try-finally where it possible (Koc)
This PR was merged into the 3.1 branch. Discussion ---------- Use try-finally where it possible | Q | A | ------------- | --- | Branch? | 3.1 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Just a minior refactoring for using PHP 5.5 feature. Commits ------- 747ddf6 Use try-finally where it possible
2 parents 560cb57 + 75baf2e commit a6eca66

File tree

1 file changed

+9
-15
lines changed

1 file changed

+9
-15
lines changed

Compiler/AutowirePass.php

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -45,21 +45,15 @@ public function process(ContainerBuilder $container)
4545
$this->completeDefinition($id, $definition);
4646
}
4747
}
48-
} catch (\Exception $e) {
49-
} catch (\Throwable $e) {
50-
}
51-
52-
spl_autoload_unregister($throwingAutoloader);
53-
54-
// Free memory and remove circular reference to container
55-
$this->container = null;
56-
$this->reflectionClasses = array();
57-
$this->definedTypes = array();
58-
$this->types = null;
59-
$this->ambiguousServiceTypes = array();
60-
61-
if (isset($e)) {
62-
throw $e;
48+
} finally {
49+
spl_autoload_unregister($throwingAutoloader);
50+
51+
// Free memory and remove circular reference to container
52+
$this->container = null;
53+
$this->reflectionClasses = array();
54+
$this->definedTypes = array();
55+
$this->types = null;
56+
$this->ambiguousServiceTypes = array();
6357
}
6458
}
6559

0 commit comments

Comments
 (0)