QueryCompatExtension::ignore()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
crap 2
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