-
Notifications
You must be signed in to change notification settings - Fork 11.5k
Closed
Labels
Description
Laravel Version
11.39.0
PHP Version
8.4.2
Database Driver & Version
No response
Description
This deals specifically with PR #54000.
This line broke my unit tests due to fact that uniqueVia()
returns a Illuminate\Contracts\Cache\Repository
contract. getName()
is only on Illuminate\Cache\Repository
, not the individual drivers.
Steps To Reproduce
Create a queue job class that implements ShouldBeUnique
with a uniqueVia
method that returns a Cache driver:
<?php
namespace App\Jobs;
use Illuminate\Contracts\Cache\Repository;
use Illuminate\Contracts\Queue\ShouldBeUnique;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Queue\Queueable;
use Illuminate\Support\Facades\Cache;
class TestJob implements ShouldBeUnique, ShouldQueue
{
use Queueable;
public function handle(): void
{
//
}
public function uniqueVia(): Repository
{
return Cache::driver('array');
}
}
augusl