| Conditions | 3 |
| Paths | 2 |
| Total Lines | 8 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | 132 | final public function testConditions($parameterName, $value, $itemType = false) |
|
| 20 | { |
||
| 21 | 132 | if (is_numeric($value)) { |
|
| 22 | 60 | $test = '$%1$s %3$s %2$s'; |
|
| 23 | 30 | } else { |
|
| 24 | 72 | $test = '($time = (string) time()) && \DateTime::createFromFormat(\'U\', $time)->add(new \DateInterval(preg_replace(\'/(.*)(\.[0-9]*S)/\', \'$1S\', $%1$s))) %3$s \DateTime::createFromFormat(\'U\', $time)->add(new \DateInterval(preg_replace(\'/(.*)(\.[0-9]*S)/\', \'$1S\', \'%2$s\')))'; |
|
| 25 | } |
||
| 26 | 132 | return sprintf(($itemType ? '' : '!is_null($%1$s) && ') . $test, $parameterName, $value, $this->symbol()); |
|
| 27 | } |
||
| 40 |