|
@@ 1439-1448 (lines=10) @@
|
| 1436 |
|
* False if not or if it could not be reliably determined |
| 1437 |
|
* (variable or calculations and such). |
| 1438 |
|
*/ |
| 1439 |
|
public function isPositiveNumber(\PHP_CodeSniffer_File $phpcsFile, $start, $end, $allowFloats = false) |
| 1440 |
|
{ |
| 1441 |
|
$number = $this->isNumber($phpcsFile, $start, $end, $allowFloats); |
| 1442 |
|
|
| 1443 |
|
if ($number === false) { |
| 1444 |
|
return false; |
| 1445 |
|
} |
| 1446 |
|
|
| 1447 |
|
return ($number > 0); |
| 1448 |
|
} |
| 1449 |
|
|
| 1450 |
|
|
| 1451 |
|
/** |
|
@@ 1471-1481 (lines=11) @@
|
| 1468 |
|
* False if not or if it could not be reliably determined |
| 1469 |
|
* (variable or calculations and such). |
| 1470 |
|
*/ |
| 1471 |
|
public function isNegativeNumber(\PHP_CodeSniffer_File $phpcsFile, $start, $end, $allowFloats = false) |
| 1472 |
|
{ |
| 1473 |
|
$number = $this->isNumber($phpcsFile, $start, $end, $allowFloats); |
| 1474 |
|
|
| 1475 |
|
if ($number === false) { |
| 1476 |
|
return false; |
| 1477 |
|
} |
| 1478 |
|
|
| 1479 |
|
return ($number < 0); |
| 1480 |
|
|
| 1481 |
|
} |
| 1482 |
|
|
| 1483 |
|
/** |
| 1484 |
|
* Determine whether the tokens between $start and $end together form a number |