diff --git a/components/Components/URLSearchParams.php b/components/Components/URLSearchParams.php index 07a944a3..eba714d5 100644 --- a/components/Components/URLSearchParams.php +++ b/components/Components/URLSearchParams.php @@ -19,7 +19,6 @@ use Deprecated; use Iterator; use IteratorAggregate; -use League\Uri\Contracts\Conditionable; use League\Uri\Contracts\QueryInterface; use League\Uri\Contracts\UriComponentInterface; use League\Uri\Contracts\UriException; diff --git a/interfaces/Contracts/Conditionable.php b/interfaces/Contracts/Conditionable.php index 29fd91a0..385a78cc 100644 --- a/interfaces/Contracts/Conditionable.php +++ b/interfaces/Contracts/Conditionable.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + declare(strict_types=1); namespace League\Uri\Contracts; diff --git a/uri/Uri.php b/uri/Uri.php index 64b9311d..09c09d69 100644 --- a/uri/Uri.php +++ b/uri/Uri.php @@ -37,7 +37,6 @@ use function base64_decode; use function base64_encode; use function count; -use function dd; use function end; use function explode; use function file_get_contents; @@ -1338,11 +1337,11 @@ public function isCrossOrigin(UriInterface|Stringable|string $uri): bool $uri = self::tryNew($uri); } - if (null === $uri?->getOrigin()) { + if (null === $uri || null === ($origin = $uri->getOrigin())) { return true; } - return $this->origin !== (string) $this->getOrigin(); + return $this->origin !== (string) $origin; } public function isSameOrigin(Stringable|string $uri): bool