Skip to content

InvalidUrlException should check $errors argument #19780

@nyamsprod

Description

@nyamsprod

Description

The following code:

<?php
use Uri\WhatWg\InvalidUrlException;

$e =  new InvalidUrlException('message', ['foo' => 'bar']);
$e->errors;

Resulted in this output:

['foo' => 'bar']

But I expected this output instead:

a `ValueError` to be thrown since errors is supposed to be a list of `Uri\WhatWg\UrlValidationError`

PHP Version

PHP 8.5.0beta1 (cli) (built: Aug 18 2025 13:04:01) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.5.0-dev, Copyright (c) Zend Technologies
    with Zend OPcache v8.5.0beta1, Copyright (c), by Zend Technologies

Operating System

MacOS

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions