Passed
Push — master ( bb4a5a...93d148 )
by Jhao
02:16
created

becauseEmptyTrackingResponse()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 3
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 5
ccs 0
cts 4
cp 0
crap 2
rs 10
1
<?php
2
3
/**
4
 * This file is part of RussianPost SDK package.
5
 *
6
 * © Appwilio (http://appwilio.com), greabock (https://github.com/greabock), JhaoDa (https://github.com/jhaoda)
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace Appwilio\RussianPostSDK\Tracking\Exceptions;
15
16
class SingleAccessException extends \Exception
17
{
18
    public const EMPTY_TRACKING_RESPONSE = 1;
19
    public const EMPTY_COD_RESPONSE      = 2;
20
21
    public static function becauseEmptyTrackingResponse(string $trackingNumber): self
22
    {
23
        return new self(
24
            "Почта России не смогла найти событий трекинга для РПО #{$trackingNumber}.",
25
            self::EMPTY_TRACKING_RESPONSE
26
        );
27
    }
28
29
    public static function becauseEmptyCODResponse(string $trackingNumber): self
30
    {
31
        return new self(
32
            "Почта России не смогла найти событий обработки наложенного платежа для РПО #{$trackingNumber}.",
33
            self::EMPTY_COD_RESPONSE
34
        );
35
    }
36
}
37