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.
Completed
Push — master ( 71dda7...a6b423 )
by Kevin
06:24 queued 03:09
created

OrderId::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 3
1
<?php
2
3
namespace Magium\Magento\Extractors\Checkout;
4
5
use Magium\AbstractTestCase;
6
use Magium\Extractors\AbstractExtractor;
7
use Magium\Magento\Actions\Checkout\Steps\StepInterface;
8
use Magium\Magento\Themes\OnePageCheckout\AbstractThemeConfiguration;
9
use Magium\WebDriver\WebDriver;
10
11
class OrderId extends AbstractExtractor implements StepInterface
12
{
13
14
    const EXTRACTOR = 'Checkout\OrderId';
15
16
    public function __construct(WebDriver $webDriver, AbstractTestCase $testCase, AbstractThemeConfiguration $theme)
17
    {
18
        parent::__construct($webDriver, $testCase, $theme);
19
    }
20
21
22
    public function getOrderId()
23
    {
24
        return $this->getValue('order-id');
25
    }
26
27
    public function extract()
28
    {
29
        $theme = $this->theme;
30
        if ($theme instanceof AbstractThemeConfiguration) {
31
            $this->testCase->assertElementDisplayed($theme->getOrderNumberExtractorXpath(), AbstractTestCase::BY_XPATH);
32
            $element = $this->webDriver->byXpath($theme->getOrderNumberExtractorXpath());
33
            $text = $element->getText();
34
            $orderId = preg_replace('/\D/', '', $text);
35
            $this->values['order-id'] = $orderId;
36
            return true;
37
        } else {
38
            return false;
39
        }
40
    }
41
42
    public function execute()
43
    {
44
        $this->extract();
45
        return true;
46
    }
47
48
    public function nextAction()
49
    {
50
        return true;
51
    }
52
53
}