patterns[] = $pattern; return $this; } /** * Detects if the log matches all patterns * * Returns true if all patterns are found, false otherwise * * @return bool|float */ public function detect(): bool|float { foreach ($this->patterns as $pattern) { if (preg_match($pattern, $this->getLogContent()) !== 1) { return false; } } return true; } }