Test Failed
Branch master (3f2e80)
by Gabriel
03:43 queued 01:39
created

PurchaseResponse::getViewFile()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace ByTIC\Omnipay\Paylike\Message;
4
5
use ByTIC\Omnipay\Common\Message\Traits\HasViewTrait;
6
use ByTIC\Omnipay\Paylike\Helper;
7
use Omnipay\Common\Message\RedirectResponseInterface;
8
9
/**
10
 * Class PurchaseResponse
11
 * @package ByTIC\Omnipay\Paylike\Message
12
 */
13
class PurchaseResponse extends AbstractResponse implements RedirectResponseInterface
14
{
15
    use HasViewTrait;
16
17
18
    protected function initViewVars()
19
    {
20
        $data = $this->getData();
21
        $data['returnUrl'] .= strpos($data['returnUrl'], '?') === false ? $data['returnUrl'] . '?' : '';
22
        $this->getView()->with($data);
0 ignored issues
show
Bug introduced by
The method with() does not exist on ByTIC\Omnipay\Common\Library\View\View. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

22
        $this->getView()->/** @scrutinizer ignore-call */ with($data);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
23
    }
24
25
    /**
26
     * @inheritDoc
27
     */
28
    protected function generateViewPath()
29
    {
30
        return Helper::viewsPath();
31
    }
32
33
    /**
34
     * @return string
35
     */
36
    protected function getViewFile()
37
    {
38
        return 'purchase';
39
    }
40
}
41