Parameters::getVnpHashSecret()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
/**
3
 * @link https://github.com/phpviet/omnipay-vnpay
4
 *
5
 * @copyright (c) PHP Viet
6
 * @license [MIT](https://opensource.org/licenses/MIT)
7
 */
8
9
namespace Omnipay\VNPay\Concerns;
10
11
/**
12
 * @author Vuong Minh <[email protected]>
13
 * @since 1.0.0
14
 */
15
trait Parameters
16
{
17
    /**
18
     * Trả về mã Tmn do VNPay cấp.
19
     *
20
     * @return null|string
21
     */
22
    public function getVnpVersion(): ?string
23
    {
24
        return $this->getParameter('vnp_Version');
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?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
25
    }
26
27
    /**
28
     * Thiết lập mã Tmn.
29
     *
30
     * @param  null|string  $code
31
     * @return $this
32
     */
33
    public function setVnpVersion(?string $code)
34
    {
35
        return $this->setParameter('vnp_Version', $code);
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?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
36
    }
37
38
    /**
39
     * Trả về mã Tmn do VNPay cấp.
40
     *
41
     * @return null|string
42
     */
43
    public function getVnpTmnCode(): ?string
44
    {
45
        return $this->getParameter('vnp_TmnCode');
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?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
46
    }
47
48
    /**
49
     * Thiết lập mã Tmn.
50
     *
51
     * @param  null|string  $code
52
     * @return $this
53
     */
54
    public function setVnpTmnCode(?string $code)
55
    {
56
        return $this->setParameter('vnp_TmnCode', $code);
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?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
57
    }
58
59
    /**
60
     * Trả về khóa dùng để tạo chữ ký dữ liệu.
61
     *
62
     * @return null|string
63
     */
64
    public function getVnpHashSecret(): ?string
65
    {
66
        return $this->getParameter('vnp_HashSecret');
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?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
67
    }
68
69
    /**
70
     * Thiết lập khóa dùng để tạo chữ ký dữ liệu.
71
     *
72
     * @param  null|string  $secret
73
     *
74
     * @return $this
75
     */
76
    public function setVnpHashSecret(?string $secret)
77
    {
78
        return $this->setParameter('vnp_HashSecret', $secret);
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?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
79
    }
80
}
81