Skip to content

Commit 5f420a0

Browse files
committed
Php Inspections (EA Extended) - static code analysis includes:
Reduce couple count calls in [Yaml] Modernize type casting, fix several strict comparisons Unsets merged Elvis operator usage Short syntax for applied operations
1 parent 3e3979c commit 5f420a0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Util/XmlUtils.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,17 +191,17 @@ public static function phpize($value)
191191
return;
192192
case ctype_digit($value):
193193
$raw = $value;
194-
$cast = intval($value);
194+
$cast = (int) $value;
195195

196-
return '0' == $value[0] ? octdec($value) : (((string) $raw == (string) $cast) ? $cast : $raw);
196+
return '0' == $value[0] ? octdec($value) : (((string) $raw === (string) $cast) ? $cast : $raw);
197197
case 'true' === $lowercaseValue:
198198
return true;
199199
case 'false' === $lowercaseValue:
200200
return false;
201201
case is_numeric($value):
202-
return '0x' == $value[0].$value[1] ? hexdec($value) : floatval($value);
202+
return '0x' === $value[0].$value[1] ? hexdec($value) : (float) $value;
203203
case preg_match('/^(-|\+)?[0-9]+(\.[0-9]+)?$/', $value):
204-
return floatval($value);
204+
return (float) $value;
205205
default:
206206
return $value;
207207
}

0 commit comments

Comments
 (0)