LazyCollectionLoader   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
dl 0
loc 17
rs 10
c 1
b 0
f 0
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A processCollection() 0 7 3
1
<?php
2
3
namespace Charcoal\Loader;
4
5
/**
6
 * Lazy Object Collection Loader
7
 */
8
class LazyCollectionLoader extends CollectionLoader
9
{
10
    /**
11
     * Process the collection of raw data.
12
     *
13
     * @param  mixed[]|Traversable $results The raw result set.
0 ignored issues
show
Bug introduced by
The type Charcoal\Loader\Traversable was not found. Did you mean Traversable? If so, make sure to prefix the type with \.
Loading history...
14
     * @param  callable|null       $before  Process each entity before applying raw data.
15
     * @param  callable|null       $after   Process each entity after applying raw data.
16
     * @return ModelInterface[]|\Generator
17
     */
18
    protected function processCollection($results, callable $before = null, callable $after = null)
19
    {
20
        foreach ($results as $objData) {
21
            $obj = $this->processModel($objData, $before, $after);
22
23
            if ($obj instanceof ModelInterface) {
0 ignored issues
show
Bug introduced by
The type Charcoal\Loader\ModelInterface was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
24
                yield $obj;
25
            }
26
        }
27
    }
28
}
29