YaKassaRequest::getCustomerNumber()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
1
<?php
2
3
/**
4
 * This file is part of Ya.Kassa package.
5
 *
6
 * © Appwilio (http://appwilio.com)
7
 * © JhaoDa (https://github.com/jhaoda)
8
 *
9
 * For the full copyright and license information, please view the LICENSE
10
 * file that was distributed with this source code.
11
 */
12
declare(strict_types=1);
13
14
namespace Appwilio\YaKassa;
15
16
use Symfony\Component\HttpFoundation\ParameterBag;
17
18
class YaKassaRequest
19
{
20
    /** @var ParameterBag */
21
    private $parameters;
22
23 6
    public function __construct(array $parameters)
24
    {
25 6
        $this->parameters = new ParameterBag($parameters);
26 6
    }
27
28 6
    public function getAction(): string
29
    {
30 6
        return $this->get('action');
31
    }
32
33
    public function getOrderNumber(): string
34
    {
35
        return $this->get('orderNumber');
36
    }
37
38
    public function getCustomerNumber(): string
39
    {
40
        return $this->get('customerNumber');
41
    }
42
43
    public function getInvoiceId(): string
44
    {
45
        return $this->get('invoiceId');
46
    }
47
48 6
    public function get(string $name): string
49
    {
50 6
        return $this->parameters->get($name);
51
    }
52
53 6
    public function all(): array
54
    {
55 6
        return $this->parameters->all();
56
    }
57
}
58