Skip to content

Commit 53cfc15

Browse files
committed
Minor optimization
1 parent 92a665c commit 53cfc15

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Rule/ForbidArithmeticOperationOnNonNumberRule.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,9 @@ private function isFloat(Type $type): bool
182182
private function containsBcMathNumber(Type $type): bool
183183
{
184184
$bcMathFound = false;
185-
TypeTraverser::map($type, static function (Type $traversedTyped, callable $traverse) use (&$bcMathFound): Type {
186-
$bcMathNumber = new ObjectType('BcMath\Number');
185+
$bcMathNumber = new ObjectType('BcMath\Number');
186+
187+
TypeTraverser::map($type, static function (Type $traversedTyped, callable $traverse) use (&$bcMathFound, $bcMathNumber): Type {
187188
if ($bcMathNumber->isSuperTypeOf($traversedTyped)->yes()) {
188189
$bcMathFound = true;
189190
}

0 commit comments

Comments
 (0)