Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
7 / 7 |
ArrayFilterMismatchException | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |
100.00% |
7 / 7 |
__construct | |
100.00% |
1 / 1 |
1 | |
100.00% |
7 / 7 |
1 | <?php |
2 | |
3 | namespace Qmp\Laravel\MongoLow\Exceptions; |
4 | |
5 | use Exception; |
6 | use Illuminate\Support\Str; |
7 | |
8 | /** |
9 | * ArrayFilter count mismatch exception |
10 | */ |
11 | class ArrayFilterMismatchException extends Exception |
12 | { |
13 | /** |
14 | * Base message |
15 | * |
16 | * @var string |
17 | */ |
18 | protected $message = 'Filters count must match filtered positional operators count. ?? needed, but ??'; |
19 | |
20 | /** |
21 | * Constructor |
22 | * |
23 | * @param int $operators |
24 | * @param int $filters |
25 | */ |
26 | public function __construct($operators, $filters) |
27 | { |
28 | parent::__construct( |
29 | Str::replaceArray( |
30 | '??', |
31 | [ |
32 | $operators . ' ' . Str::plural('filter', $operators), |
33 | $filters . ' ' . Str::plural('filter', $filters) . ' ' . Str::plural('found', $filters) |
34 | ], |
35 | $this->message |
36 | ) |
37 | ); |
38 | } |
39 | } |