Test Failed
Push — master ( 6192c0...3f2e80 )
by Gabriel
03:05
created

HasKeysTrait   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A setPublicKey() 0 3 1
A setPrivateKey() 0 3 1
A getPublicKey() 0 3 1
A getPrivateKey() 0 3 1
1
<?php
2
3
namespace ByTIC\Omnipay\Paylike\Traits;
4
5
use Omnipay\Common\Message\AbstractRequest as CommonAbstractRequest;
6
7
/**
8
 * Trait HasKeysTrait
9
 * @package ByTIC\Omnipay\Paylike\Traits
10
 */
11
trait HasKeysTrait
12
{
13
14
    /**
15
     * @return mixed
16
     */
17
    public function getPrivateKey()
18
    {
19
        return $this->getParameter('privateKey');
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

19
        return $this->/** @scrutinizer ignore-call */ getParameter('privateKey');
Loading history...
20
    }
21
22
    /**
23
     * @param $value
24
     * @return CommonAbstractRequest
25
     */
26
    public function setPrivateKey($value)
27
    {
28
        return $this->setParameter('privateKey', $value);
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

28
        return $this->/** @scrutinizer ignore-call */ setParameter('privateKey', $value);
Loading history...
29
    }
30
31
    /**
32
     * @return mixed
33
     */
34
    public function getPublicKey()
35
    {
36
        return $this->getParameter('publicKey');
37
    }
38
39
    /**
40
     * @param $value
41
     * @return CommonAbstractRequest
42
     */
43
    public function setPublicKey($value)
44
    {
45
        return $this->setParameter('publicKey', $value);
46
    }
47
}
48