PurchaseResponse::generateViewPath()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Paytic\Omnipay\Paylike\Message;
4
5
use Paytic\Omnipay\Common\Message\Traits\HasViewTrait;
6
use Paytic\Omnipay\Paylike\Helper;
7
8
/**
9
 * Class PurchaseResponse
10
 * @package Paytic\Omnipay\Paylike\Message
11
 */
12
class PurchaseResponse extends AbstractResponse
13
{
14
    use HasViewTrait;
15
16
    protected function initViewVars()
17
    {
18
        $data = $this->getData();
19
        $data['returnUrl'] .= strpos($data['returnUrl'], '?') === false ? $data['returnUrl'] . '?' : '';
20
        $this->getView()->with($data);
21
    }
22
23
    /**
24
     * @inheritDoc
25
     */
26
    protected function generateViewPath()
27
    {
28
        return Helper::viewsPath();
29
    }
30
31
    /**
32
     * @return string
33
     */
34
    protected function getViewFile()
35
    {
36
        return 'purchase';
37
    }
38
}
39