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

PageIndexShouldNotBeNegativeException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
dl 0
loc 14
rs 10
c 1
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getI18n() 0 7 1
A __construct() 0 3 1
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