Skip to content

Commit 75baf2e

Browse files
committed
Use try-finally where it possible
1 parent 4cc95d1 commit 75baf2e

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)