Differential D25030 Diff 82 src/lint/linter/xhpast/rules/ArcanistBinaryNumericScalarCasingXHPASTLinterRule.php
Changeset View
Changeset View
Standalone View
Standalone View
src/lint/linter/xhpast/rules/ArcanistBinaryNumericScalarCasingXHPASTLinterRule.php
Context not available. | |||||
$binaries = $this->getBinaryNumericScalars($root); | $binaries = $this->getBinaryNumericScalars($root); | ||||
foreach ($binaries as $binary) { | foreach ($binaries as $binary) { | ||||
$value = substr($binary->getConcreteString(), 2); | $value = @substr($binary->getConcreteString(), 2); | ||||
if (!preg_match('/^0b[01]+$/', $binary->getConcreteString())) { | if (!@preg_match('/^0b[01]+$/', $binary->getConcreteString())) { | ||||
$this->raiseLintAtNode( | $this->raiseLintAtNode( | ||||
$binary, | $binary, | ||||
pht( | pht( | ||||
Context not available. | |||||
foreach ($numeric_scalars as $numeric_scalar) { | foreach ($numeric_scalars as $numeric_scalar) { | ||||
$number = $numeric_scalar->getConcreteString(); | $number = $numeric_scalar->getConcreteString(); | ||||
if (preg_match('/^0b[01]+$/i', $number)) { | if (@preg_match('/^0b[01]+$/i', $number)) { | ||||
$binary_numeric_scalars[] = $numeric_scalar; | $binary_numeric_scalars[] = $numeric_scalar; | ||||
} | } | ||||
} | } | ||||
Context not available. |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0