File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
rules-tests/CodeQuality/Rector/Foreach_/ForeachItemsAssignToEmptyArrayToAssignRector/Fixture Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Rector \Tests \CodeQuality \Rector \Foreach_ \ForeachItemsAssignToEmptyArrayToAssignRector \Fixture ;
4+
5+ class SkipDivisionByZero
6+ {
7+ function run ($ mode )
8+ {
9+ $ x = 1 / 0 ;
10+ }
11+ }
Original file line number Diff line number Diff line change 44
55namespace Rector \PhpParser \Node \Value ;
66
7+ use ArithmeticError ;
78use PhpParser \ConstExprEvaluationException ;
89use PhpParser \ConstExprEvaluator ;
910use PhpParser \Node \Arg ;
@@ -157,7 +158,7 @@ private function resolveExprValueForConst(Expr|InterpolatedStringPart $expr): mi
157158 try {
158159 $ constExprEvaluator = $ this ->getConstExprEvaluator ();
159160 return $ constExprEvaluator ->evaluateDirectly ($ expr );
160- } catch (ConstExprEvaluationException |TypeError ) {
161+ } catch (ConstExprEvaluationException |TypeError | ArithmeticError ) {
161162 }
162163
163164 if ($ expr instanceof Class_) {
You can’t perform that action at this time.
0 commit comments