Parameters::setWebsiteId()   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 1
1
<?php
2
/**
3
 * @link https://github.com/phpviet/omnipay-vtcpay
4
 *
5
 * @copyright (c) PHP Viet
6
 * @license [MIT](https://opensource.org/licenses/MIT)
7
 */
8
9
namespace Omnipay\VTCPay\Concerns;
10
11
/**
12
 * @author Vuong Minh <[email protected]>
13
 * @since 1.0.0
14
 */
15
trait Parameters
16
{
17
    /**
18
     * Trả về mã website.
19
     *
20
     * @return null|string
21
     */
22
    public function getWebsiteId(): ?string
23
    {
24
        return $this->getParameter('website_id');
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ã website.
29
     *
30
     * @param  null|string  $id
31
     *
32
     * @return $this
33
     */
34
    public function setWebsiteId(?string $id)
35
    {
36
        return $this->setParameter('website_id', $id);
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...
37
    }
38
39
    /**
40
     * Trả về mã bảo mật.
41
     *
42
     * @return null|string
43
     */
44
    public function getSecurityCode(): ?string
45
    {
46
        return $this->getParameter('security_code');
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...
47
    }
48
49
    /**
50
     * Thiết lập mã bảo mật dùng để tạo chữ ký dữ liệu.
51
     *
52
     * @param  string  $code
53
     *
54
     * @return $this
55
     */
56
    public function setSecurityCode(?string $code)
57
    {
58
        return $this->setParameter('security_code', $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...
59
    }
60
}
61