PageIndexShouldNotBeNegativeException::getI18n()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 0
dl 0
loc 7
rs 10
c 0
b 0
f 0
1
<?php
2
namespace W2w\Lib\Apie\Exceptions;
3
4
use W2w\Lib\ApieObjectAccessNormalizer\Exceptions\ApieException;
5
use W2w\Lib\ApieObjectAccessNormalizer\Exceptions\LocalizationableException;
6
use W2w\Lib\ApieObjectAccessNormalizer\Exceptions\LocalizationInfo;
7
8
/**
9
 * Exception thrown when the page index filled in for pagination is negative.
10
 */
11
class PageIndexShouldNotBeNegativeException extends ApieException implements LocalizationableException
12
{
13
    public function __construct()
14
    {
15
        parent::__construct(422, 'Page index should not be negative!');
16
    }
17
18
    public function getI18n(): LocalizationInfo
19
    {
20
        return new LocalizationInfo(
21
            'validation.min',
22
            [
23
                'value' => 'page',
24
                'minimum' => 0
25
            ]
26
        );
27
    }
28
}
29