SequenceNumber   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 7
c 1
b 0
f 0
dl 0
loc 23
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setSequenceNumber() 0 4 1
A getSequenceNumber() 0 6 2
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 sequence number API request parameter.
9
 *
10
 * @author Fabian Böttcher <[email protected]>
11
 * @since 0.1.0
12
 */
13
trait SequenceNumber
14
{
15
    /**
16
     * @inheritDoc
17
     */
18
    public function getSequenceNumber(): ?int
19
    {
20
        $sequenceNumber = $this->getParameter('sequencenumber');
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
        /** @scrutinizer ignore-call */ 
21
        $sequenceNumber = $this->getParameter('sequencenumber');
Loading history...
21
        return $sequenceNumber !== null
22
            ? (int) $sequenceNumber
23
            : null;
24
    }
25
26
    /**
27
     * Sets the sequence number.
28
     *
29
     * @param int $sequenceNumber The sequence number.
30
     * @return $this
31
     */
32
    public function setSequenceNumber(int $sequenceNumber): self
33
    {
34
        $this->setParameter('sequencenumber', (string) $sequenceNumber);
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

34
        $this->/** @scrutinizer ignore-call */ 
35
               setParameter('sequencenumber', (string) $sequenceNumber);
Loading history...
35
        return $this;
36
    }
37
}
38