Skip to content

Commit 6cf7d11

Browse files
committed
use try-finally when possible
1 parent 2fdb511 commit 6cf7d11

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

OptionsResolver.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -783,11 +783,9 @@ public function offsetGet($option)
783783
foreach ($this->lazy[$option] as $closure) {
784784
$value = $closure($this, $value);
785785
}
786-
} catch (\Exception $e) {
786+
} finally {
787787
unset($this->calling[$option]);
788-
throw $e;
789788
}
790-
unset($this->calling[$option]);
791789
// END
792790
}
793791

@@ -885,11 +883,9 @@ public function offsetGet($option)
885883
$this->calling[$option] = true;
886884
try {
887885
$value = $normalizer($this, $value);
888-
} catch (\Exception $e) {
886+
} finally {
889887
unset($this->calling[$option]);
890-
throw $e;
891888
}
892-
unset($this->calling[$option]);
893889
// END
894890
}
895891

0 commit comments

Comments
 (0)