You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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');
}
}
The text was updated successfully, but these errors were encountered:
As Laravel is an open source project, we rely on the community to help us diagnose and fix issues as it is not possible to research and fix every issue reported to us via GitHub.
If possible, please make a pull request fixing the issue you have described, along with corresponding tests. All pull requests are promptly reviewed by the Laravel team.
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 aIlluminate\Contracts\Cache\Repository
contract.getName()
is only onIlluminate\Cache\Repository
, not the individual drivers.Steps To Reproduce
Create a queue job class that implements
ShouldBeUnique
with auniqueVia
method that returns a Cache driver:The text was updated successfully, but these errors were encountered: