@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | public static function isInInterval(int $number, string $interval): bool { |
| 27 | - if(is_null(static::findInterval($interval)) OR $interval !== static::findInterval($interval)) { |
|
| 27 | + if(is_null(static::findInterval($interval)) or $interval !== static::findInterval($interval)) { |
|
| 28 | 28 | return false; |
| 29 | 29 | } |
| 30 | 30 | if(Strings::startsWith($interval, "{")) { |
@@ -42,9 +42,9 @@ discard block |
||
| 42 | 42 | return false; |
| 43 | 43 | } elseif($number > $limit2) { |
| 44 | 44 | return false; |
| 45 | - } elseif($number === $limit1 AND $start === "]") { |
|
| 45 | + } elseif($number === $limit1 and $start === "]") { |
|
| 46 | 46 | return false; |
| 47 | - } elseif($number === $limit2 AND $end === "[") { |
|
| 47 | + } elseif($number === $limit2 and $end === "[") { |
|
| 48 | 48 | return false; |
| 49 | 49 | } |
| 50 | 50 | return true; |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | * Check whether a number is within boundaries |
| 23 | 23 | */ |
| 24 | 24 | public static function isInRange(int $number, int $min, int $max): bool { |
| 25 | - return ($number >= $min AND $number <= $max); |
|
| 25 | + return ($number >= $min and $number <= $max); |
|
| 26 | 26 | } |
| 27 | 27 | } |
| 28 | 28 | ?> |
| 29 | 29 | \ No newline at end of file |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | final class Filter { |
| 15 | 15 | use \Nette\StaticClass; |
| 16 | 16 | |
| 17 | - public const OPERATORS = ["==", ">=", ">", "<=", "<", "!=",]; |
|
| 17 | + public const OPERATORS = ["==", ">=", ">", "<=", "<", "!=", ]; |
|
| 18 | 18 | |
| 19 | 19 | public static function getOperator(string $input): string { |
| 20 | 20 | foreach(static::OPERATORS as $operator) { |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | * @param int $index |
| 51 | 51 | */ |
| 52 | 52 | public function offsetExists($index): bool { |
| 53 | - return $index >= 0 AND $index < count($this->items); |
|
| 53 | + return $index >= 0 and $index < count($this->items); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | /** |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | * @throws \OutOfRangeException |
| 60 | 60 | */ |
| 61 | 61 | public function offsetGet($index) { |
| 62 | - if($index < 0 OR $index >= count($this->items)) { |
|
| 62 | + if($index < 0 or $index >= count($this->items)) { |
|
| 63 | 63 | throw new \OutOfRangeException("Offset invalid or out of range."); |
| 64 | 64 | } |
| 65 | 65 | return $this->items[$index]; |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | return; |
| 97 | 97 | } |
| 98 | 98 | if($this->hasItems([$uniqueProperty => $newItem->$uniqueProperty])) { |
| 99 | - throw new \RuntimeException("Duplicate $uniqueProperty {$newItem->$uniqueProperty}."); |
|
| 99 | + throw new \RuntimeException("duplicate $uniqueProperty {$newItem->$uniqueProperty}."); |
|
| 100 | 100 | } |
| 101 | 101 | } |
| 102 | 102 | |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | $this->performChecks($item); |
| 133 | 133 | if($index === null) { |
| 134 | 134 | $this->items[] = & $item; |
| 135 | - } elseif($index < 0 OR $index >= count($this->items)) { |
|
| 135 | + } elseif($index < 0 or $index >= count($this->items)) { |
|
| 136 | 136 | throw new \OutOfRangeException("Offset invalid or out of range."); |
| 137 | 137 | } else { |
| 138 | 138 | $this->items[$index] = & $item; |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | public function offsetUnset($index): void { |
| 147 | 147 | if($this->locked) { |
| 148 | 148 | throw new \RuntimeException("Cannot remove items from locked collection."); |
| 149 | - } elseif($index < 0 OR $index >= count($this->items)) { |
|
| 149 | + } elseif($index < 0 or $index >= count($this->items)) { |
|
| 150 | 150 | throw new \OutOfRangeException("Offset invalid or out of range."); |
| 151 | 151 | } |
| 152 | 152 | array_splice($this->items, $index, 1); |