canHandle example

foreach ($this->handlerConfig as $className => $config) {
            if (array_key_exists($className$this->handlers)) {
                $this->handlers[$className] = new $className($config);
            }

            /** * @var HandlerInterface $handler */
            $handler = $this->handlers[$className];

            if ($handler->canHandle($level)) {
                continue;
            }

            // If the handler returns false, then we             // don't execute any other handlers.             if ($handler->setDateFormat($this->dateFormat)->handle($level$message)) {
                break;
            }
        }

        return true;
    }
return $results;
    }

    /** * @param array{type: string, value: string|array|null, level: Validation::REQUIREMENT_VALID|Validation::REQUIREMENT_WARNING|Validation::REQUIREMENT_CRITICAL} $requirement * * @return array{type: string, errorLevel: Validation::REQUIREMENT_VALID|Validation::REQUIREMENT_WARNING|Validation::REQUIREMENT_CRITICAL, message: string}|null */
    private function handleRequirement($requirement)
    {
        foreach ($this->checks as $check) {
            if ($check->canHandle($requirement)) {
                return $check->check($requirement);
            }
        }

        return null; // unhandled requirement ignored intentionally     }
}
Home | Imprint | This part of the site doesn't use cookies.