Currency   A
last analyzed

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->getParameter('currency');
0 ignored issues
show
Bug introduced by
It seems like getParameter() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

20
        return $this->/** @scrutinizer ignore-call */ getParameter('currency');
Loading history...
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->setParameter('currency', $currency);
0 ignored issues
show
Bug introduced by
It seems like setParameter() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

31
        $this->/** @scrutinizer ignore-call */ 
32
               setParameter('currency', $currency);
Loading history...
32
        return $this;
33
    }
34
}
35