Pix   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 54
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 54
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getInstruction() 0 3 1
A getExpiration() 0 3 1
A __construct() 0 6 1
A getTitle() 0 3 1
1
<?php
2
/**
3
 * Copyright © Getnet. All rights reserved.
4
 *
5
 * @author    Bruno Elisei <[email protected]>
6
 * See LICENSE for license details.
7
 */
8
9
namespace Getnet\PaymentMagento\Block\Sales\Form;
10
11
use Getnet\PaymentMagento\Gateway\Config\ConfigPix;
12
use Magento\Framework\View\Element\Template\Context;
13
14
/**
15
 * Class Pix - Form for payment by Pix.
16
 */
17
class Pix extends \Magento\Payment\Block\Form
18
{
19
    /**
20
     * Pix template.
21
     *
22
     * @var string
23
     */
24
    protected $_template = 'Getnet_PaymentMagento::form/pix.phtml';
25
26
    /**
27
     * @var ConfigPix
28
     */
29
    protected $configPix;
30
31
    /**
32
     * @param Context   $context
33
     * @param ConfigPix $configPix
34
     */
35
    public function __construct(
36
        Context $context,
37
        ConfigPix $configPix
38
    ) {
39
        parent::__construct($context);
40
        $this->configPix = $configPix;
41
    }
42
43
    /**
44
     * Title - Pix.
45
     *
46
     * @return string
47
     */
48
    public function getTitle()
49
    {
50
        return $this->configPix->getTitle();
51
    }
52
53
    /**
54
     * Instruction - Pix.
55
     *
56
     * @return string
57
     */
58
    public function getInstruction()
59
    {
60
        return $this->configPix->getInstructionCheckout();
61
    }
62
63
    /**
64
     * Expiration - Pix.
65
     *
66
     * @return string
67
     */
68
    public function getExpiration()
69
    {
70
        return $this->configPix->getExpirationFormat();
0 ignored issues
show
Bug introduced by
The method getExpirationFormat() does not exist on Getnet\PaymentMagento\Gateway\Config\ConfigPix. ( Ignorable by Annotation )

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

70
        return $this->configPix->/** @scrutinizer ignore-call */ getExpirationFormat();

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...
71
    }
72
}
73