Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call to an undefined method Illuminate\Contracts\Cache\Repository::lock() #2061

Open
FrankMawn opened this issue Oct 8, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@FrankMawn
Copy link

  • Larastan Version: v2.9.8
  • Laravel Version: v11.26.0

Description

I want to use the lock() method on the database cache store using the code below and phpstan complains that the lock() method isn't found on the cache repository contract.

Not sure how to best tackle that? To me this code seems perflectly valid in terms of syntax.

Laravel code where the issue was found

// This works fine.
Cache::lock('scheduler', 5)->get();

// This throws an error.
Cache::store('database')->lock('scheduler', 5);
@FrankMawn FrankMawn added the bug Something isn't working label Oct 8, 2024
@calebdw
Copy link
Contributor

calebdw commented Oct 8, 2024

What's the point of type-hinting contracts if you're not going to abide by them? Just a pet peeve of mine with the framework...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants