Completed
Push — master ( 187043...48cde4 )
by
unknown
01:30
created

src/Exceptions/InvalidAppendQuery.php (2 issues)

parameters are used.

Unused Code Minor

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
namespace Spatie\QueryBuilder\Exceptions;
4
5
use Illuminate\Http\Response;
6
use Illuminate\Support\Collection;
7
8 View Code Duplication
class InvalidAppendQuery extends InvalidQuery
9
{
10
    /** @var \Illuminate\Support\Collection */
11
    public $appendsNotAllowed;
12
13
    /** @var \Illuminate\Support\Collection */
14
    public $allowedAppends;
15
16
    public function __construct(Collection $appendsNotAllowed, Collection $allowedAppends)
17
    {
18
        $this->appendsNotAllowed = $appendsNotAllowed;
19
        $this->allowedAppends = $allowedAppends;
20
21
        $appendsNotAllowed = $appendsNotAllowed->implode(', ');
22
        $allowedAppends = $allowedAppends->implode(', ');
23
        $message = "Requested append(s) `{$appendsNotAllowed}` are not allowed. Allowed append(s) are `{$allowedAppends}`.";
24
25
        parent::__construct(Response::HTTP_BAD_REQUEST, $message);
26
    }
27
28
    public static function appendsNotAllowed(Collection $appendsNotAllowed, Collection $allowedAppends)
0 ignored issues
show
The parameter $appendsNotAllowed is not used and could be removed.

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

Loading history...
The parameter $allowedAppends is not used and could be removed.

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

Loading history...
29
    {
30
        return new static(...func_get_args());
31
    }
32
}
33