PageQuery::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
nc 1
nop 2
dl 0
loc 4
ccs 0
cts 3
cp 0
crap 2
rs 10
c 1
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Leonidas\Library\System\Model\Page;
6
7
use Leonidas\Contracts\System\Model\Page\PageCollectionInterface;
8
use Leonidas\Contracts\System\Schema\Post\PostConverterInterface;
9
use Leonidas\Library\System\Model\Abstracts\Post\PoweredByModelQueryKernelTrait;
10
use Leonidas\Library\System\Model\Abstracts\Post\ValidatesPostTypeTrait;
11
use Leonidas\Library\System\Model\Page\Abstracts\AbstractPageCollection;
12
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...
13
14
class PageQuery extends AbstractPageCollection implements PageCollectionInterface
15
{
16
    use ValidatesPostTypeTrait;
0 ignored issues
show
Bug introduced by
The trait Leonidas\Library\System\...\ValidatesPostTypeTrait requires the property $post_type which is not provided by Leonidas\Library\System\Model\Page\PageQuery.
Loading history...
17
    use PoweredByModelQueryKernelTrait;
18
19
    public function __construct(WP_Query $query, PostConverterInterface $converter)
20
    {
21
        $this->assertPostTypeOnQuery($query, 'page');
22
        $this->initKernel($query, $converter);
23
    }
24
}
25