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

SingleAccessException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 18
ccs 8
cts 8
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A becauseEmptyTrackingResponse() 0 5 1
A becauseEmptyCODResponse() 0 5 1
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