Test Failed
Push — master ( ef92f3...ef7525 )
by Chris
12:32
created

PostQueryFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 7
dl 0
loc 17
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A createQuery() 0 3 1
A __construct() 0 4 1
1
<?php
2
3
namespace Leonidas\Library\System\Model\Post;
4
5
use Leonidas\Contracts\System\Schema\Post\PostConverterInterface;
6
use Leonidas\Contracts\System\Schema\Post\QueryFactoryInterface;
7
use Leonidas\Library\System\Model\Post\PostQuery;
8
use WebTheory\Collection\Comparison\ObjectComparator;
9
use WP_Query;
0 ignored issues
show
Bug introduced by
The type WP_Query 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...
10
11
class PostQueryFactory implements QueryFactoryInterface
12
{
13
    protected ObjectComparator $comparator;
14
15
    protected PostConverterInterface $converter;
16
17
    protected array $accessors = [];
18
19
    public function __construct(PostConverterInterface $converter, ObjectComparator $comparator)
20
    {
21
        $this->converter = $converter;
22
        $this->comparator = $comparator;
23
    }
24
25
    public function createQuery(WP_Query $query): PostQuery
26
    {
27
        return new PostQuery($query, $this->converter);
28
    }
29
}
30