@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | /** |
| 107 | 107 | * @param string|int $level |
| 108 | 108 | */ |
| 109 | - public function hasRecords(string|int $level): bool |
|
| 109 | + public function hasRecords(string | int $level): bool |
|
| 110 | 110 | { |
| 111 | 111 | return isset($this->recordsByLevel[$level]); |
| 112 | 112 | } |
@@ -115,27 +115,27 @@ discard block |
||
| 115 | 115 | * @param string|array<string, mixed> $record |
| 116 | 116 | * @param string|int $level |
| 117 | 117 | */ |
| 118 | - public function hasRecord($record, string|int $level): bool |
|
| 118 | + public function hasRecord($record, string | int $level): bool |
|
| 119 | 119 | { |
| 120 | 120 | if (\is_string($record)) { |
| 121 | 121 | $record = ['message' => $record]; |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | - return $this->hasRecordThatPasses(static function (array $rec) use ($record) { |
|
| 124 | + return $this->hasRecordThatPasses(static function(array $rec) use ($record) { |
|
| 125 | 125 | if ($rec['message'] !== $record['message']) { |
| 126 | 126 | return false; |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | - return ! isset($record['context']) || $rec['context'] === $record['context']; |
|
| 129 | + return !isset($record['context']) || $rec['context'] === $record['context']; |
|
| 130 | 130 | }, $level); |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | /** |
| 134 | 134 | * @param string|int $level |
| 135 | 135 | */ |
| 136 | - public function hasRecordThatContains(string $message, string|int $level): bool |
|
| 136 | + public function hasRecordThatContains(string $message, string | int $level): bool |
|
| 137 | 137 | { |
| 138 | - return $this->hasRecordThatPasses(static function (array $rec) use ($message) { |
|
| 138 | + return $this->hasRecordThatPasses(static function(array $rec) use ($message) { |
|
| 139 | 139 | return \strpos($rec['message'], $message) !== false; |
| 140 | 140 | }, $level); |
| 141 | 141 | } |
@@ -143,9 +143,9 @@ discard block |
||
| 143 | 143 | /** |
| 144 | 144 | * @param string|int $level |
| 145 | 145 | */ |
| 146 | - public function hasRecordThatMatches(string $regex, string|int $level): bool |
|
| 146 | + public function hasRecordThatMatches(string $regex, string | int $level): bool |
|
| 147 | 147 | { |
| 148 | - return $this->hasRecordThatPasses(static function ($rec) use ($regex) { |
|
| 148 | + return $this->hasRecordThatPasses(static function($rec) use ($regex) { |
|
| 149 | 149 | return \preg_match($regex, $rec['message']) > 0; |
| 150 | 150 | }, $level); |
| 151 | 151 | } |
@@ -154,9 +154,9 @@ discard block |
||
| 154 | 154 | * @param callable(array<string, mixed>, int): bool $predicate |
| 155 | 155 | * @param string|int $level |
| 156 | 156 | */ |
| 157 | - public function hasRecordThatPasses(callable $predicate, string|int $level): bool |
|
| 157 | + public function hasRecordThatPasses(callable $predicate, string | int $level): bool |
|
| 158 | 158 | { |
| 159 | - if (! isset($this->recordsByLevel[$level])) { |
|
| 159 | + if (!isset($this->recordsByLevel[$level])) { |
|
| 160 | 160 | return false; |
| 161 | 161 | } |
| 162 | 162 | |
@@ -175,8 +175,8 @@ discard block |
||
| 175 | 175 | public function __call(string $method, array $args): bool |
| 176 | 176 | { |
| 177 | 177 | $levelNames = \implode('|', \array_map('ucfirst', \array_keys($this->levelMap))); |
| 178 | - if (\preg_match('/(.*)(' . $levelNames . ')(.*)/', $method, $matches) > 0) { |
|
| 179 | - $genericMethod = $matches[1] . ($matches[3] !== 'Records' ? 'Record' : '') . $matches[3]; |
|
| 178 | + if (\preg_match('/(.*)('.$levelNames.')(.*)/', $method, $matches) > 0) { |
|
| 179 | + $genericMethod = $matches[1].($matches[3] !== 'Records' ? 'Record' : '').$matches[3]; |
|
| 180 | 180 | $callable = [$this, $genericMethod]; |
| 181 | 181 | $level = $this->levelMap[\strtolower($matches[2])]; |
| 182 | 182 | if (\is_callable($callable)) { |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | } |
| 187 | 187 | } |
| 188 | 188 | |
| 189 | - throw new \BadMethodCallException('Call to undefined method ' . static::class . '::' . $method . '()'); |
|
| 189 | + throw new \BadMethodCallException('Call to undefined method '.static::class.'::'.$method.'()'); |
|
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | public function reset(): void |