Issues (590)

src/Query/QueryCompatExtension.php (1 issue)

Severity
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
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