getLogContentAsArray(); $matchingCounter = 0; foreach ($lines as $line) { if (preg_match($this->pattern, $line) === 1) { $matchingCounter++; } } if ($matchingCounter === 0) { return false; } return $matchingCounter / count($lines); } }