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

InvalidPageLimitException   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 __construct() 0 3 1
A getI18n() 0 7 1
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