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
Pull Request — master (#104)
by Kevin
08:25
created

CheckMoneyOrder::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 7
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 7
loc 7
rs 9.4285
c 1
b 0
f 0
cc 1
eloc 5
nc 1
nop 2
1
<?php
2
3
namespace Magium\Magento\Actions\Checkout\PaymentMethods;
4
5
use Magium\Magento\AbstractMagentoTestCase;
6
use Magium\WebDriver\WebDriver;
7
8 View Code Duplication
class CheckMoneyOrder implements PaymentMethodInterface
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
9
{
10
11
    const ACTION = 'Checkout\PaymentMethods\CheckMoneyOrder';
12
13
    protected $webDriver;
14
    protected $testCase;
15
16
    public function __construct(
17
        WebDriver                   $webDriver,
18
        AbstractMagentoTestCase     $testCase
19
    ) {
20
        $this->webDriver    = $webDriver;
21
        $this->testCase     = $testCase;
22
    }
23
24
    public function getId()
25
    {
26
        return 'p_method_checkmo';
27
    }
28
29
    /**
30
     * Fills in the payment form, selecting it, if necessary
31
     *
32
     * @param $requirePayment
33
     */
34
35
    public function pay($requirePayment)
36
    {
37
        if ($requirePayment) {
38
            $this->testCase->assertElementExists($this->getId());
39
        }
40
41
        if ($this->webDriver->elementDisplayed($this->getId())) {
42
            $element = $this->webDriver->byId($this->getId());
43
            $this->webDriver->getMouse()->click($element->getCoordinates());
44
        }
45
    }
46
}
47