AbstractSignatureResponse::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 2
1
<?php
2
/**
3
 * @link https://github.com/phpviet/omnipay-momo
4
 * @copyright (c) PHP Viet
5
 * @license [MIT](http://www.opensource.org/licenses/MIT)
6
 */
7
8
namespace Omnipay\MoMo\Message;
9
10
use Omnipay\Common\Message\RequestInterface;
11
12
/**
13
 * @author Vuong Minh <[email protected]>
14
 * @since 1.0.0
15
 */
16
abstract class AbstractSignatureResponse extends AbstractResponse
17
{
18
    use Concerns\ResponseSignatureValidation;
19
20
    /**
21
     * Khởi tạo đối tượng Response.
22
     *
23
     * @param  \Omnipay\Common\Message\RequestInterface  $request
24
     * @param $data
25
     * @throws \Omnipay\Common\Exception\InvalidResponseException
26
     */
27
    public function __construct(RequestInterface $request, $data)
28
    {
29
        parent::__construct($request, $data);
30
31
        if ('0' === $this->getCode()) {
32
            $this->validateSignature();
33
        }
34
    }
35
}
36