Skip to content

Commit e5ea9a0

Browse files
committed
chore: fix CS
1 parent 3993bc8 commit e5ea9a0

File tree

11 files changed

+15
-30
lines changed

11 files changed

+15
-30
lines changed

src/Client.php

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,25 +64,25 @@ final class Client extends AbstractBrowser implements WebDriver, JavaScriptExecu
6464
/**
6565
* @param string[]|null $arguments
6666
*/
67-
public static function createChromeClient(?string $chromeDriverBinary = null, ?array $arguments = null, array $options = [], ?string $baseUri = null): self
67+
public static function createChromeClient(string $chromeDriverBinary = null, array $arguments = null, array $options = [], string $baseUri = null): self
6868
{
6969
return new self(new ChromeManager($chromeDriverBinary, $arguments, $options), $baseUri);
7070
}
7171

7272
/**
7373
* @param string[]|null $arguments
7474
*/
75-
public static function createFirefoxClient(?string $geckodriverBinary = null, ?array $arguments = null, array $options = [], ?string $baseUri = null): self
75+
public static function createFirefoxClient(string $geckodriverBinary = null, array $arguments = null, array $options = [], string $baseUri = null): self
7676
{
7777
return new self(new FirefoxManager($geckodriverBinary, $arguments, $options), $baseUri);
7878
}
7979

80-
public static function createSeleniumClient(?string $host = null, ?WebDriverCapabilities $capabilities = null, ?string $baseUri = null, array $options = []): self
80+
public static function createSeleniumClient(string $host = null, WebDriverCapabilities $capabilities = null, string $baseUri = null, array $options = []): self
8181
{
8282
return new self(new SeleniumManager($host, $capabilities, $options), $baseUri);
8383
}
8484

85-
public function __construct(BrowserManagerInterface $browserManager, ?string $baseUri = null)
85+
public function __construct(BrowserManagerInterface $browserManager, string $baseUri = null)
8686
{
8787
$this->browserManager = $browserManager;
8888
$this->baseUri = $baseUri;
@@ -630,8 +630,6 @@ public function switchTo(): WebDriverTargetLocator
630630
/**
631631
* @param string $name
632632
* @param array $params
633-
*
634-
* @return mixed
635633
*/
636634
public function execute($name, $params)
637635
{
@@ -661,8 +659,6 @@ public function findElements(WebDriverBy $locator): array
661659
* @param string $script
662660
*
663661
* @throws \Exception
664-
*
665-
* @return mixed
666662
*/
667663
public function executeScript($script, array $arguments = [])
668664
{
@@ -677,8 +673,6 @@ public function executeScript($script, array $arguments = [])
677673
* @param string $script
678674
*
679675
* @throws \Exception
680-
*
681-
* @return mixed
682676
*/
683677
public function executeAsyncScript($script, array $arguments = [])
684678
{

src/Cookie/CookieJar.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ private function webDriverToSymfony(WebDriverCookie $cookie): Cookie
133133
return new Cookie($cookie->getName(), $cookie->getValue(), $expiry, $cookie->getPath(), (string) $cookie->getDomain(), (bool) $cookie->isSecure(), (bool) $cookie->isHttpOnly());
134134
}
135135

136-
private function getWebDriverCookie(string $name, string $path = '/', ?string $domain = null): ?WebDriverCookie
136+
private function getWebDriverCookie(string $name, string $path = '/', string $domain = null): ?WebDriverCookie
137137
{
138138
try {
139139
$cookie = $this->webDriver->manage()->getCookieNamed($name);

src/DomCrawler/Crawler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ final class Crawler extends BaseCrawler implements WebDriverElement
3434
/**
3535
* @param WebDriverElement[] $elements
3636
*/
37-
public function __construct(array $elements = [], ?WebDriver $webDriver = null, ?string $uri = null)
37+
public function __construct(array $elements = [], WebDriver $webDriver = null, string $uri = null)
3838
{
3939
$this->uri = $uri;
4040
$this->webDriver = $webDriver;
@@ -390,7 +390,7 @@ private function selectFromXpath(string $xpath): self
390390
/**
391391
* @param WebDriverElement[]|null $nodes
392392
*/
393-
private function createSubCrawler(?array $nodes = null): self
393+
private function createSubCrawler(array $nodes = null): self
394394
{
395395
return new self($nodes ?? [], $this->webDriver, $this->uri);
396396
}

src/DomCrawler/Form.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,6 @@ public function set(FormField $field): void
209209
}
210210

211211
/**
212-
* @param mixed $name
213-
*
214212
* @return FormField|FormField[]|FormField[][]
215213
*/
216214
public function get($name): FormField|array
@@ -344,9 +342,6 @@ private function getValue(WebDriverElement $element)
344342
return $values;
345343
}
346344

347-
/**
348-
* @param mixed $value
349-
*/
350345
private function setValue(string $name, $value): void
351346
{
352347
try {

src/PantherTestCaseTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,8 @@ protected static function createPantherClient(array $options = [], array $kernel
166166
if (null !== self::$pantherClient) {
167167
$browserManager = self::$pantherClient->getBrowserManager();
168168
if (
169-
(PantherTestCase::CHROME === $browser && $browserManager instanceof ChromeManager) ||
170-
(PantherTestCase::FIREFOX === $browser && $browserManager instanceof FirefoxManager)
169+
(PantherTestCase::CHROME === $browser && $browserManager instanceof ChromeManager)
170+
|| (PantherTestCase::FIREFOX === $browser && $browserManager instanceof FirefoxManager)
171171
) {
172172
ServerExtension::registerClient(self::$pantherClient);
173173

src/ProcessManager/ChromeManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ final class ChromeManager implements BrowserManagerInterface
3434
/**
3535
* @throws \RuntimeException
3636
*/
37-
public function __construct(?string $chromeDriverBinary = null, ?array $arguments = null, array $options = [])
37+
public function __construct(string $chromeDriverBinary = null, array $arguments = null, array $options = [])
3838
{
3939
$this->options = $options ? array_merge($this->getDefaultOptions(), $options) : $this->getDefaultOptions();
4040
$this->process = $this->createProcess($chromeDriverBinary ?: $this->findChromeDriverBinary());

src/ProcessManager/FirefoxManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ final class FirefoxManager implements BrowserManagerInterface
3333
/**
3434
* @throws \RuntimeException
3535
*/
36-
public function __construct(?string $geckodriverBinary = null, ?array $arguments = null, array $options = [])
36+
public function __construct(string $geckodriverBinary = null, array $arguments = null, array $options = [])
3737
{
3838
$this->options = array_merge($this->getDefaultOptions(), $options);
3939
$this->process = new Process([$geckodriverBinary ?: $this->findGeckodriverBinary(), '--port='.$this->options['port']], null, null, null, null);

src/ProcessManager/SeleniumManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ final class SeleniumManager implements BrowserManagerInterface
2929

3030
public function __construct(
3131
?string $host = 'http://127.0.0.1:4444/wd/hub',
32-
?WebDriverCapabilities $capabilities = null,
32+
WebDriverCapabilities $capabilities = null,
3333
?array $options = []
3434
) {
3535
$this->host = $host;

src/WebDriver/PantherWebDriverExpectedCondition.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public static function elementTextNotContains(WebDriverBy $by, string $text): ca
2525
try {
2626
$elementText = $driver->findElement($by)->getText();
2727

28-
return false === strpos($elementText, $text);
28+
return !str_contains($elementText, $text);
2929
} catch (StaleElementReferenceException $e) {
3030
return null;
3131
}
@@ -63,7 +63,7 @@ public static function elementAttributeContains(WebDriverBy $by, string $attribu
6363
try {
6464
$attributeValue = $driver->findElement($by)->getAttribute($attribute);
6565

66-
return null !== $attributeValue && false !== strpos($attributeValue, $text);
66+
return null !== $attributeValue && str_contains($attributeValue, $text);
6767
} catch (StaleElementReferenceException $e) {
6868
return null;
6969
}
@@ -77,7 +77,7 @@ public static function elementAttributeNotContains(WebDriverBy $by, string $attr
7777
try {
7878
$attributeValue = $driver->findElement($by)->getAttribute($attribute);
7979

80-
return null !== $attributeValue && false === strpos($attributeValue, $text);
80+
return null !== $attributeValue && !str_contains($attributeValue, $text);
8181
} catch (StaleElementReferenceException $e) {
8282
return null;
8383
}

tests/DomCrawler/CrawlerTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,6 @@ public function testChildren(callable $clientFactory): void
247247

248248
/**
249249
* @dataProvider clientFactoryProvider
250-
*
251-
* @param mixed $clientFactory
252250
*/
253251
public function testChildrenFilter($clientFactory): void
254252
{

0 commit comments

Comments
 (0)