{"record":{"id":"c526d94f7b772fd6","repo":"Seldaek/monolog","slug":"url-url-is-not-valid","errorCode":null,"errorMessage":"URL \"${url}\" is not valid","messagePattern":"URL \"(.+?)\" is not valid","errorType":"exception","errorClass":"UnexpectedValueException","httpStatus":null,"severity":"error","filePath":"src/Monolog/Handler/CubeHandler.php","lineNumber":47,"sourceCode":"    private string $scheme;\n    private string $host;\n    private int $port;\n    /** @var string[] */\n    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","sourceCodeStart":29,"sourceCodeEnd":65,"githubUrl":"https://github.com/Seldaek/monolog/blob/57eb1028342134e701e77c617565d51b6e5a2a53/src/Monolog/Handler/CubeHandler.php#L29-L65","documentation":"Error \"URL \"${url}\" is not valid\" thrown in Seldaek/monolog.","triggerScenarios":"Thrown at src/Monolog/Handler/CubeHandler.php:47 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"}