| Conditions | 2 |
| Paths | 2 |
| Total Lines | 24 |
| Code Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php namespace GeneaLabs\LaravelModelCaching; |
||
| 8 | protected function eagerLoadRelation(array $models, $name, Closure $constraints) |
||
| 9 | { |
||
| 10 | $relation = $this->getRelation($name); |
||
| 11 | $relation->addEagerConstraints($models); |
||
| 12 | $constraints($relation); |
||
| 13 | |||
| 14 | $parentIds = implode('_', collect($models)->pluck('id')->toArray()); |
||
| 15 | $parentName = str_slug(get_class($relation->getParent())); |
||
| 16 | $childName = str_slug(get_class($relation->getRelated())); |
||
| 17 | $cache = cache(); |
||
| 18 | |||
| 19 | if (is_subclass_of(cache()->getStore(), TaggableStore::class)) { |
||
|
|
|||
| 20 | $cache->tags([$parentName, $childName]); |
||
| 21 | } |
||
| 22 | |||
| 23 | $results = $cache |
||
| 24 | ->rememberForever("{$parentName}_{$parentIds}-{$childName}s", function () use ($relation) { |
||
| 25 | return $relation->getEager(); |
||
| 26 | }); |
||
| 27 | |||
| 28 | return $relation->match( |
||
| 29 | $relation->initRelation($models, $name), |
||
| 30 | $results, |
||
| 31 | $name |
||
| 32 | ); |
||
| 35 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths