Skip to content

Commit

Permalink
Fix phpstan violations
Browse files Browse the repository at this point in the history
  • Loading branch information
justafish committed Oct 5, 2023
1 parent 9fcd973 commit 8371ae4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 8 additions & 0 deletions phpstan.dist.neon
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ parameters:
- '#^Method Behat\\Mink\\Tests\\Driver\\Custom\\[^:]+Test(Case)?\:\:test\w*\(\) has no return type specified\.$#'
# instaclick/php-webdriver misses the @method for this magic method
- '#^Call to an undefined method WebDriver\\Session\:\:file\(\)\.$#'
# W3C compatability changes
- '#^Call to an undefined method WebDriver\\Session\:\:getWindowHandles\(\)\.$#'
- '#^Call to an undefined method WebDriver\\Session\:\:getWindowHandle\(\)\.$#'
- '#^Call to an undefined method WebDriver\\Session\:\:postActions\(\)\.$#'
- '#^Call to an undefined method WebDriver\\Session\:\:deleteActions\(\)\.$#'
- '#^Call to an undefined method WebDriver\\Session|WebDriver\\Window\\:\:postRect\(\)\.$#'
- '#^Access to undefined constant WebDriver\\Element\:\:WEB_ELEMENT_ID\.$#'
- '#^Call to an undefined method WebDriver\\Element\:\:property\(\)\.$#'

includes:
- vendor/phpstan/phpstan-phpunit/extension.neon
Expand Down
8 changes: 0 additions & 8 deletions src/Selenium2Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -548,8 +548,6 @@ public function getScreenshot()
public function getWindowNames()
{
if ($this->isW3C()) {
// This method doesn't exist in older versions of php-webdriver.
/** @phpstan-ignore-next-line variable.undefined */
return $this->getWebDriverSession()->getWindowHandles();
}

Expand All @@ -559,8 +557,6 @@ public function getWindowNames()
public function getWindowName()
{
if ($this->isW3C()) {
// This method doesn't exist in older versions of php-webdriver.
/** @phpstan-ignore-next-line variable.undefined */
return $this->getWebDriverSession()->getWindowHandle();
}

Expand Down Expand Up @@ -667,8 +663,6 @@ public function getValue(string $xpath)
}

if ($this->isW3C()) {
// This method doesn't exist in older versions of php-webdriver.
/** @phpstan-ignore-next-line variable.undefined */
return $element->property('value');
}

Expand Down Expand Up @@ -1100,8 +1094,6 @@ public function wait(int $timeout, string $condition)
public function resizeWindow(int $width, int $height, ?string $name = null)
{
if ($this->isW3C()) {
// This method doesn't exist in older versions of php-webdriver.
/** @phpstan-ignore-next-line variable.undefined */
$this->getWebDriverSession()->window($name ? $name : 'current')->postRect(
array('width' => $width, 'height' => $height)
);
Expand Down

0 comments on commit 8371ae4

Please sign in to comment.