Passed
Push — master ( d743e2...20969e )
by Jhao
01:54
created

SingleAccessException::becauseEmptyCODResponse()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 3
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 5
ccs 4
cts 4
cp 1
crap 1
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 1
    public static function becauseEmptyTrackingResponse(string $trackingNumber): self
22
    {
23 1
        return new self(
24 1
            "Почта России не смогла найти событий трекинга для РПО #{$trackingNumber}.",
25 1
            self::EMPTY_TRACKING_RESPONSE
26
        );
27
    }
28
29 1
    public static function becauseEmptyCODResponse(string $trackingNumber): self
30
    {
31 1
        return new self(
32 1
            "Почта России не смогла найти событий обработки наложенного платежа для РПО #{$trackingNumber}.",
33 1
            self::EMPTY_COD_RESPONSE
34
        );
35
    }
36
}
37