YaKassaRequest   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Test Coverage

Coverage 60%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 38
ccs 9
cts 15
cp 0.6
rs 10
wmc 7

7 Methods

Rating   Name   Duplication   Size   Complexity  
A getOrderNumber() 0 3 1
A __construct() 0 3 1
A getCustomerNumber() 0 3 1
A get() 0 3 1
A getInvoiceId() 0 3 1
A getAction() 0 3 1
A all() 0 3 1
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