GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

SimpleFormGenerator   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 0
dl 0
loc 49
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A render() 0 9 3
A showSubmitButton() 0 4 1
A setFormName() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the Marlon Ogone package.
5
 *
6
 * (c) Marlon BVBA <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Ogone\FormGenerator;
13
14
use Ogone\Ecommerce\EcommercePaymentRequest;
15
16
class SimpleFormGenerator implements FormGenerator
17
{
18
    /**
19
     * @deprecated
20
     * @var null
21
     */
22
    private $formName = null;
23
24
    /**
25
     * @deprecated
26
     * @var null
27
     */
28
    private $showSubmitButton = null;
29
30
    /**
31
     * @param EcommercePaymentRequest $ecommercePaymentRequest
32
     * @param string $formName
33
     * @param bool $showSubmitButton
34
     * @param string $textSubmitButton The text displayed on the submit button of the form. Defaults to "Submit"
35
     * @return string HTML
36
     */
37 3
    public function render(EcommercePaymentRequest $ecommercePaymentRequest, $formName = 'ogone', $showSubmitButton = true, $textSubmitButton = 'Submit')
38
    {
39 3
        $formName = null !== $this->formName?$this->formName:$formName;
0 ignored issues
show
Deprecated Code introduced by
The property Ogone\FormGenerator\SimpleFormGenerator::$formName has been deprecated.

This property has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the property will be removed from the class and what other property to use instead.

Loading history...
40 3
        $showSubmitButton = null !== $this->showSubmitButton?$this->showSubmitButton:$showSubmitButton;
0 ignored issues
show
Deprecated Code introduced by
The property Ogone\FormGenerator\Simp...ator::$showSubmitButton has been deprecated.

This property has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the property will be removed from the class and what other property to use instead.

Loading history...
41
42 3
        ob_start();
43 3
        include __DIR__.'/template/simpleForm.php';
44 3
        return ob_get_clean();
45
    }
46
47
    /**
48
     * @deprecated Will be removed in next major released, directly integrated in render method.
49
     * @param bool $bool
50
     */
51
    public function showSubmitButton($bool = true)
52
    {
53
        $this->showSubmitButton = $bool;
0 ignored issues
show
Documentation Bug introduced by
It seems like $bool of type boolean is incompatible with the declared type null of property $showSubmitButton.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
Deprecated Code introduced by
The property Ogone\FormGenerator\Simp...ator::$showSubmitButton has been deprecated.

This property has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the property will be removed from the class and what other property to use instead.

Loading history...
54
    }
55
56
    /**
57
     * @deprecated Will be removed in next major released, directly integrated in render method.
58
     * @param $formName
59
     */
60
    public function setFormName($formName)
61
    {
62
        $this->formName = $formName;
0 ignored issues
show
Deprecated Code introduced by
The property Ogone\FormGenerator\SimpleFormGenerator::$formName has been deprecated.

This property has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the property will be removed from the class and what other property to use instead.

Loading history...
63
    }
64
}
65