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

Currency::getCurrency()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
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