Completed
Push — 4.0 ( 268f2c...88f012 )
by Hideki
05:48 queued 10s
created

_support/Interactions/DragAndDropBy.php (1 issue)

Severity

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
/*
4
 * This file is part of EC-CUBE
5
 *
6
 * Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
7
 *
8
 * http://www.ec-cube.co.jp/
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Interactions;
15
16
use Facebook\WebDriver\Interactions\Internal\WebDriverButtonReleaseAction;
17
use Facebook\WebDriver\Interactions\Internal\WebDriverClickAndHoldAction;
18
use Facebook\WebDriver\Interactions\Internal\WebDriverMoveToOffsetAction;
19
use Facebook\WebDriver\Interactions\WebDriverActions;
20
use Facebook\WebDriver\WebDriver;
21
22
class DragAndDropBy extends WebDriverActions
23
{
24
    /**
25
     * @param \Facebook\WebDriver\Remote\RemoteWebElement $source
26
     */
27
    public function __construct(WebDriver $driver, $source, $x_offset, $y_offset)
28
    {
29
        parent::__construct($driver);
0 ignored issues
show
$driver is of type object<Facebook\WebDriver\WebDriver>, but the function expects a object<Facebook\WebDrive...bDriverHasInputDevices>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
30
        $this->action->addAction(
31
            new WebDriverClickAndHoldAction($this->mouse, $source)
32
        );
33
        $this->action->addAction(
34
            new WaitAction(1)
35
        );
36
        $this->action->addAction(
37
            new WebDriverMoveToOffsetAction($this->mouse, null, $x_offset, $y_offset)
38
        );
39
        $this->action->addAction(
40
            new WaitAction(1)
41
        );
42
        $this->action->addAction(
43
            new WebDriverButtonReleaseAction($this->mouse, null)
44
        );
45
        $this->action->addAction(
46
            new WaitAction(1)
47
        );
48
    }
49
}
50