Passed
Push — master ( bfa84d...d19f7c )
by payever
02:58
created

CreatePaymentV2Response::isValid()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 3
nc 3
nop 0
1
<?php
2
3
/**
4
 * PHP version 5.4 and 8
5
 *
6
 * @category  ResponseEntity
7
 * @package   Payever\Payments
8
 * @author    payever GmbH <[email protected]>
9
 * @copyright 2017-2021 payever GmbH
10
 * @license   MIT <https://opensource.org/licenses/MIT>
11
 * @link      https://docs.payever.org/shopsystems/api/getting-started
12
 */
13
14
namespace Payever\ExternalIntegration\Payments\Http\ResponseEntity;
15
16
use Payever\ExternalIntegration\Core\Http\MessageEntity\CallEntity;
17
use Payever\ExternalIntegration\Core\Http\ResponseEntity;
18
use Payever\ExternalIntegration\Payments\Http\MessageEntity\CreatePaymentV2CallEntity;
19
20
/**
21
 * This class represents Create Payment ResponseInterface Entity
22
 *
23
 * @method string getRedirectUrl()
24
 * @method self   setRedirectUrl(string $url)
25
 */
26
class CreatePaymentV2Response extends ResponseEntity
27
{
28
    /** @var string $redirectUrl */
29
    protected $redirectUrl;
30
31
    /**
32
     * {@inheritdoc}
33
     */
34
    public function getRequired()
35
    {
36
        return [
37
            'call',
38
            'redirect_url',
39
        ];
40
    }
41
42
    /**
43
     * {@inheritdoc}
44
     */
45
    public function isValid()
46
    {
47
        return parent::isValid() &&
48
            ($this->call   instanceof CallEntity   && $this->call->isValid())
49
        ;
50
    }
51
52
    /**
53
     * {@inheritdoc}
54
     */
55
    public function setCall($call)
56
    {
57
        $this->call = new CreatePaymentV2CallEntity($call);
58
    }
59
}
60