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

InvalidIdException::getI18n()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 6
rs 10
c 0
b 0
f 0
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
class InvalidIdException 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

7
class InvalidIdException extends /** @scrutinizer ignore-deprecated */ ApieException implements LocalizationableException
Loading history...
8
{
9
    private $id;
10
11
    public function __construct(string $id)
12
    {
13
        $this->id = $id;
14
        parent::__construct(500, 'Id "' . $id . '" is not valid as identifier');
15
    }
16
17
    public function getI18n(): LocalizationInfo
18
    {
19
        return new LocalizationInfo(
20
            'validation.id',
21
            [
22
                'id' => $this->id
23
            ]
24
        );
25
    }
26
}
27