{"record":{"id":"ca648aa53e049bab","repo":"Seldaek/monolog","slug":"invalid-protocol-scheme-valid-options-are","errorCode":null,"errorMessage":"Invalid protocol (${scheme}). Valid options are ${options}","messagePattern":"Invalid protocol \\((.+?)\\)\\. Valid options are (.+?)","errorType":"exception","errorClass":"UnexpectedValueException","httpStatus":null,"severity":"error","filePath":"src/Monolog/Handler/CubeHandler.php","lineNumber":51,"sourceCode":"    private array $acceptedSchemes = ['http', 'udp'];\n\n    /**\n     * Create a Cube handler\n     *\n     * @throws \\UnexpectedValueException when given url is not a valid url.\n     *                                   A valid url must consist of three parts : protocol://host:port\n     *                                   Only valid protocols used by Cube are http and udp\n     */\n    public function __construct(string $url, int|string|Level $level = Level::Debug, bool $bubble = true)\n    {\n        $urlInfo = parse_url($url);\n\n        if ($urlInfo === false || !isset($urlInfo['scheme'], $urlInfo['host'], $urlInfo['port'])) {\n            throw new \\UnexpectedValueException('URL \"'.$url.'\" is not valid');\n        }\n\n        if (!\\in_array($urlInfo['scheme'], $this->acceptedSchemes, true)) {\n            throw new \\UnexpectedValueException(\n                'Invalid protocol (' . $urlInfo['scheme']  . ').'\n                . ' Valid options are ' . implode(', ', $this->acceptedSchemes)\n            );\n        }\n\n        $this->scheme = $urlInfo['scheme'];\n        $this->host = $urlInfo['host'];\n        $this->port = $urlInfo['port'];\n\n        parent::__construct($level, $bubble);\n    }\n\n    /**\n     * Establish a connection to an UDP socket\n     *\n     * @throws \\LogicException           when unable to connect to the socket\n     * @throws MissingExtensionException when there is no socket extension\n     */","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/Seldaek/monolog/blob/57eb1028342134e701e77c617565d51b6e5a2a53/src/Monolog/Handler/CubeHandler.php#L33-L69","documentation":"Error \"Invalid protocol (${scheme}). Valid options are ${options}\" thrown in Seldaek/monolog.","triggerScenarios":"Thrown at src/Monolog/Handler/CubeHandler.php:51 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"57eb1028342134e701e77c617565d51b6e5a2a53","analyzedAt":"2026-08-17T02:36:30.259Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}