HasKeysTrait   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getApiKey() 0 3 1
A setApiKey() 0 3 1
A getPublicKey() 0 3 1
A setPublicKey() 0 3 1
1
<?php
2
3
namespace ByTIC\Payments\Stripe\Message\Traits;
4
5
use Omnipay\Common\Message\AbstractRequest;
6
use Omnipay\Common\Message\AbstractRequest as CommonAbstractRequest;
7
8
/**
9
 * Trait HasKeysTrait
10
 * @package ByTIC\Payments\Stripe\Message\Traits
11
 */
12
trait HasKeysTrait
13
{
14
    /**
15
     * @return mixed
16
     */
17
    public function getPublicKey()
18
    {
19
        return $this->getParameter('publicKey');
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('publicKey');
Loading history...
20
    }
21
22
    /**
23
     * @param $value
24
     * @return CommonAbstractRequest
25
     */
26
    public function setPublicKey($value)
27
    {
28
        return $this->setParameter('publicKey', $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('publicKey', $value);
Loading history...
29
    }
30
31
    /**
32
     * Get the gateway API Key (the "secret key").
33
     *
34
     * @return string
35
     */
36
    public function getApiKey(): string
37
    {
38
        return $this->getParameter('apiKey');
39
    }
40
41
    /**
42
     * Set the gateway API Key.
43
     *
44
     * @return AbstractRequest provides a fluent interface.
45
     */
46
    public function setApiKey($value): AbstractRequest
47
    {
48
        return $this->setParameter('apiKey', $value);
49
    }
50
}
51