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.

TermsAndConditions::setCheckboxText()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace Magium\Magento\Actions\Checkout\Steps;
4
5
use Magium\Magento\AbstractMagentoTestCase;
6
use Magium\Magento\Actions\Checkout\AbstractCheckout;
7
use Magium\Magento\Themes\OnePageCheckout\AbstractThemeConfiguration;
8
use Magium\WebDriver\WebDriver;
9
10
class TermsAndConditions implements StepInterface
11
{
12
    const ACTION = 'Checkout\Steps\TermsAndConditions';
13
14
    protected $webdriver;
15
    protected $theme;
16
    protected $testCase;
17
18
    protected $checkboxText;
19
    
20
    public function __construct(
21
        WebDriver                   $webdriver,
22
        AbstractThemeConfiguration  $theme,
23
        AbstractMagentoTestCase     $testCase
24
    ) {
25
        $this->webdriver        = $webdriver;
26
        $this->theme            = $theme;
27
        $this->testCase         = $testCase;
28
    }
29
30
    public function setCheckboxText($text)
31
    {
32
        $this->checkboxText = $text;
33
    }
34
35
    public function configureCheckout(AbstractCheckout $checkout, $before = 'Magium\Magento\Actions\Checkout\Steps\PlaceOrder')
36
    {
37
        if ($before) {
38
            $before = $this->testCase->get($before);
39
        }
40
        $checkout->addStep($this, $before);
41
    }
42
43
    public function execute()
44
    {
45
        if ($this->checkboxText) {
46
            $xpath = $this->theme->getTermsAndConditionsSelectorXpath($this->checkboxText);
47
            $element = $this->webdriver->byXpath($xpath);
48
            $element->click();
49
        }
50
51
        return true;
52
    }
53
54
    public function nextAction()
55
    {
56
        return true;
57
    }
58
}