RecurringPaymentID   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 6
dl 0
loc 18
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Skrill\ValueObject;
6
7
use Skrill\ValueObject\Traits\ValueToStringTrait;
8
use Skrill\Exception\InvalidRecurringPaymentIDException;
9
10
/**
11
 * Value object for Skrill recurring payment id (rec_payment_id).
12
 *
13
 * @see https://www.skrill.com/fileadmin/content/pdf/Skrill_Wallet_Checkout_Guide.pdf
14
 */
15
final class RecurringPaymentID
16
{
17
    use ValueToStringTrait;
18
19
    /**
20
     * @param string $value
21
     *
22
     * @throws InvalidRecurringPaymentIDException
23
     */
24
    public function __construct(string $value)
25
    {
26
        $value = trim($value);
27
28
        if (empty($value)) {
29
            throw InvalidRecurringPaymentIDException::emptyTransactionID();
30
        }
31
32
        $this->value = $value;
33
    }
34
}
35