|
@@ 1452-1461 (lines=10) @@
|
| 1449 |
|
* False if not or if it could not be reliably determined |
| 1450 |
|
* (variable or calculations and such). |
| 1451 |
|
*/ |
| 1452 |
|
public function isPositiveNumber(\PHP_CodeSniffer_File $phpcsFile, $start, $end, $allowFloats = false) |
| 1453 |
|
{ |
| 1454 |
|
$number = $this->isNumber($phpcsFile, $start, $end, $allowFloats); |
| 1455 |
|
|
| 1456 |
|
if ($number === false) { |
| 1457 |
|
return false; |
| 1458 |
|
} |
| 1459 |
|
|
| 1460 |
|
return ($number > 0); |
| 1461 |
|
} |
| 1462 |
|
|
| 1463 |
|
|
| 1464 |
|
/** |
|
@@ 1484-1494 (lines=11) @@
|
| 1481 |
|
* False if not or if it could not be reliably determined |
| 1482 |
|
* (variable or calculations and such). |
| 1483 |
|
*/ |
| 1484 |
|
public function isNegativeNumber(\PHP_CodeSniffer_File $phpcsFile, $start, $end, $allowFloats = false) |
| 1485 |
|
{ |
| 1486 |
|
$number = $this->isNumber($phpcsFile, $start, $end, $allowFloats); |
| 1487 |
|
|
| 1488 |
|
if ($number === false) { |
| 1489 |
|
return false; |
| 1490 |
|
} |
| 1491 |
|
|
| 1492 |
|
return ($number < 0); |
| 1493 |
|
|
| 1494 |
|
} |
| 1495 |
|
|
| 1496 |
|
/** |
| 1497 |
|
* Determine whether the tokens between $start and $end together form a number |