| Total Complexity | 6 |
| Total Lines | 43 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 8 | trait CachePerRequest |
||
| 9 | { |
||
| 10 | public bool $requestCacheEnabled = true; |
||
| 11 | public RequestCache $requestCache; |
||
| 12 | |||
| 13 | public function __construct(array $attributes = []) |
||
| 17 | } |
||
| 18 | |||
| 19 | public function scopeDisableCache(Builder $query): Builder |
||
| 20 | { |
||
| 21 | $this->requestCacheEnabled = false; |
||
| 22 | |||
| 23 | return $query; |
||
| 24 | } |
||
| 25 | |||
| 26 | public function scopeEnableCache(Builder $query): Builder |
||
| 27 | { |
||
| 28 | $this->requestCacheEnabled = true; |
||
| 29 | |||
| 30 | return $query; |
||
| 31 | } |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @throws InvalidArgumentException |
||
| 35 | */ |
||
| 36 | public function scopeClearCache(Builder $query): Builder |
||
| 37 | { |
||
| 38 | $this->requestCache->clear(); |
||
| 39 | |||
| 40 | return $query; |
||
| 41 | } |
||
| 42 | |||
| 43 | public function getRequestCacheKey(): string |
||
| 44 | { |
||
| 45 | return 'repository-cache'; |
||
| 46 | } |
||
| 47 | |||
| 48 | public function getConnection() |
||
| 51 | } |
||
| 52 | } |
||
| 53 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.