QueryCompatExtension   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
eloc 4
dl 0
loc 24
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A count() 0 4 1
A ignore() 0 3 1
1
<?php
2
3
namespace Bdf\Prime\Query;
4
5
use Bdf\Prime\Exception\PrimeException;
6
use Bdf\Prime\Query\Contract\ReadOperation;
7
8
/**
9
 * Extension for compatibility purposes
10
 */
11
class QueryCompatExtension
12
{
13
    /**
14
     * @param QueryInterface $query
15
     * @param $flag
16
     *
17
     * @return QueryInterface
18
     */
19
    public function ignore(QueryInterface $query, $flag = true)
0 ignored issues
show
Unused Code introduced by
The parameter $flag is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

19
    public function ignore(QueryInterface $query, /** @scrutinizer ignore-unused */ $flag = true)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
20
    {
21
        return $query;
22
    }
23
24
    /**
25
     * @param QueryInterface $query
26
     * @param null|array $attributes
27
     *
28
     * @return int
29
     * @throws PrimeException
30
     */
31
    #[ReadOperation]
32
    public function count(QueryInterface $query, $attributes = null)
33
    {
34
        return count($query->all($attributes));
35
    }
36
}
37