Completed
Pull Request — develop (#13)
by Fabian
02:01
created

Currency   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 4
c 1
b 0
f 0
dl 0
loc 20
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setCurrency() 0 4 1
A getCurrency() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Cakasim\Payone\Sdk\Api\Message\Payment\Parameter;
6
7
/**
8
 * Implements getter and setter for the currency API request parameter.
9
 *
10
 * @author Fabian Böttcher <[email protected]>
11
 * @since 0.1.0
12
 */
13
trait Currency
14
{
15
    /**
16
     * @inheritDoc
17
     */
18
    public function getCurrency(): ?string
19
    {
20
        return $this->parameters['currency'] ?? null;
21
    }
22
23
    /**
24
     * Sets the currency.
25
     *
26
     * @param string $currency The transaction ID.
27
     * @return $this
28
     */
29
    public function setCurrency(string $currency): self
30
    {
31
        $this->parameters['currency'] = $currency;
0 ignored issues
show
Bug Best Practice introduced by
The property parameters does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
32
        return $this;
33
    }
34
}
35