-
Notifications
You must be signed in to change notification settings - Fork 11.5k
Closed
Description
Laravel Version
10.48.8
PHP Version
8.2.16
Database Driver & Version
No response
Description
UrlGenerator has the following deprecation notices:
- PHP Deprecated: strpos(): Passing null to
parameter #1
($haystack) of type string is deprecated in /src/vendor/laravel/framework/src/Illuminate/Routing/UrlGenerator.php on line 570 - PHP Deprecated: preg_match(): Passing null to
parameter #2
($subject) of type string is deprecated in /src/vendor/laravel/framework/src/Illuminate/Routing/UrlGenerator.php on line 633
Steps To Reproduce
This can be easily replicated with a unit test such as:
<?php
declare(strict_types=1);
namespace Tests\Unit\Actions;
use Illuminate\Testing\TestResponse;
use PHPUnit\Framework\Attributes\Test;
use Tests\TestCase;
class UrlTest extends TestCase
{
#[Test]
public function url_deprecation_test(): void
{
$redirect = redirect('/');
$response = new TestResponse(response($redirect));
$response->assertLocation('/');
}
}
Here, assertLocation
will pass a null value as $path
and trigger the deprecation notices.
Metadata
Metadata
Assignees
Labels
No labels