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

InvalidPageLimitException::getI18n()   A

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
3
4
namespace W2w\Lib\Apie\Exceptions;
5
6
use W2w\Lib\ApieObjectAccessNormalizer\Exceptions\LocalizationableException;
7
use W2w\Lib\ApieObjectAccessNormalizer\Exceptions\LocalizationInfo;
8
9
/**
10
 * Exception thrown when a page limit for the pagination is not a valid value.
11
 */
12
class InvalidPageLimitException 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

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