Passed
Push — master ( 65d8ad...c74ce3 )
by Pieter
04:45 queued 14s
created

__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
namespace W2w\Lib\Apie\Exceptions;
3
4
use W2w\Lib\ApieObjectAccessNormalizer\Exceptions\LocalizationableException;
5
use W2w\Lib\ApieObjectAccessNormalizer\Exceptions\LocalizationInfo;
6
7
/**
8
 * Exception thrown when the page index filled in for pagination is negative.
9
 */
10
class PageIndexShouldNotBeNegativeException extends ApieException implements LocalizationableException
0 ignored issues
show
Deprecated Code introduced by
The class W2w\Lib\Apie\Exceptions\ApieException has been deprecated: use \W2w\Lib\ApieObjectAccessNormalizer\Exceptions\ApieException ( Ignorable by Annotation )

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

10
class PageIndexShouldNotBeNegativeException extends /** @scrutinizer ignore-deprecated */ ApieException implements LocalizationableException
Loading history...
11
{
12
    public function __construct()
13
    {
14
        parent::__construct(422, 'Page index should not be negative!');
15
    }
16
17
    public function getI18n(): LocalizationInfo
18
    {
19
        return new LocalizationInfo(
20
            'validation.min',
21
            [
22
                'value' => 'page',
23
                'minimum' => 0
24
            ]
25
        );
26
    }
27
}
28