Skip to content

Commit e22bc5c

Browse files
authored
Merge pull request php-webdriver#1045 from OndraM/feature/test-modernize
Add typehints where safe, remove superfluous phpdoc
2 parents 764cf14 + bc653c9 commit e22bc5c

File tree

99 files changed

+374
-636
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+374
-636
lines changed

.php-cs-fixer.dist.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@
6262
'no_leading_import_slash' => true,
6363
'no_leading_namespace_whitespace' => true,
6464
'no_singleline_whitespace_before_semicolons' => true,
65+
'no_superfluous_phpdoc_tags' => [
66+
'allow_mixed' => true,
67+
'remove_inheritdoc' => true,
68+
'allow_unused_params' => true, // Used in RemoteWebDriver::createBySessionID to maintain BC
69+
],
6570
'no_trailing_comma_in_singleline' => true,
6671
'no_unreachable_default_argument_value' => true,
6772
'no_unused_imports' => true,
@@ -96,8 +101,11 @@
96101
'phpdoc_scalar' => true,
97102
'phpdoc_single_line_var_spacing' => true,
98103
'phpdoc_trim' => true,
104+
//'phpdoc_to_param_type' => true,
105+
//'phpdoc_to_return_type' => true,
99106
'phpdoc_types' => true,
100107
'phpdoc_var_annotation_correct_order' => true,
108+
//'pow_to_exponentiation' => true,
101109
'psr_autoloading' => true,
102110
'random_api_migration' => true,
103111
'self_accessor' => true,
@@ -118,6 +126,7 @@
118126
'trim_array_spaces' => true,
119127
'unary_operator_spaces' => true,
120128
'visibility_required' => ['elements' => ['method', 'property', 'const']],
129+
//'void_return' => true,
121130
'whitespace_after_comma_in_array' => true,
122131
'yoda_style' => ['equal' => false, 'identical' => false, 'less_and_greater' => false],
123132
])

lib/Chrome/ChromeOptions.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ public function setBinary($path)
6565
}
6666

6767
/**
68-
* @param array $arguments
6968
* @return ChromeOptions
7069
*/
7170
public function addArguments(array $arguments)
@@ -79,7 +78,6 @@ public function addArguments(array $arguments)
7978
* Add a Chrome extension to install on browser startup. Each path should be
8079
* a packed Chrome extension.
8180
*
82-
* @param array $paths
8381
* @return ChromeOptions
8482
*/
8583
public function addExtensions(array $paths)

lib/Exception/Internal/RuntimeException.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ public static function forError(string $message): self
1515
return new self($message);
1616
}
1717

18-
/**
19-
* @param Process $process
20-
* @return RuntimeException
21-
*/
2218
public static function forDriverError(Process $process): self
2319
{
2420
return new self(

lib/Firefox/FirefoxOptions.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ public function setPreference($name, $value)
9797

9898
/**
9999
* @see https://github.com/php-webdriver/php-webdriver/wiki/Firefox#firefox-profile
100-
* @param FirefoxProfile $profile
101100
* @return self
102101
*/
103102
public function setProfile(FirefoxProfile $profile)

lib/Interactions/Internal/WebDriverCoordinates.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ class WebDriverCoordinates
2929

3030
/**
3131
* @param null $on_screen
32-
* @param callable $in_view_port
33-
* @param callable $on_page
3432
* @param string $auxiliary
3533
*/
3634
public function __construct($on_screen, callable $in_view_port, callable $on_page, $auxiliary)

lib/Interactions/Internal/WebDriverKeysRelatedAction.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,6 @@ abstract class WebDriverKeysRelatedAction
2424
*/
2525
protected $locationProvider;
2626

27-
/**
28-
* @param WebDriverKeyboard $keyboard
29-
* @param WebDriverMouse $mouse
30-
* @param WebDriverLocatable $location_provider
31-
*/
3227
public function __construct(
3328
WebDriverKeyboard $keyboard,
3429
WebDriverMouse $mouse,

lib/Interactions/Internal/WebDriverMouseAction.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ class WebDriverMouseAction
1919
*/
2020
protected $locationProvider;
2121

22-
/**
23-
* @param WebDriverMouse $mouse
24-
* @param WebDriverLocatable|null $location_provider
25-
*/
2622
public function __construct(WebDriverMouse $mouse, WebDriverLocatable $location_provider = null)
2723
{
2824
$this->mouse = $mouse;

lib/Interactions/Internal/WebDriverMoveToOffsetAction.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ class WebDriverMoveToOffsetAction extends WebDriverMouseAction implements WebDri
1818
private $yOffset;
1919

2020
/**
21-
* @param WebDriverMouse $mouse
22-
* @param WebDriverLocatable|null $location_provider
2321
* @param int|null $x_offset
2422
* @param int|null $y_offset
2523
*/

lib/Interactions/Internal/WebDriverSendKeysAction.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ class WebDriverSendKeysAction extends WebDriverKeysRelatedAction implements WebD
1515
private $keys = '';
1616

1717
/**
18-
* @param WebDriverKeyboard $keyboard
19-
* @param WebDriverMouse $mouse
20-
* @param WebDriverLocatable $location_provider
2118
* @param string $keys
2219
*/
2320
public function __construct(

lib/Interactions/Touch/WebDriverDownAction.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ class WebDriverDownAction extends WebDriverTouchAction implements WebDriverActio
1616
private $y;
1717

1818
/**
19-
* @param WebDriverTouchScreen $touch_screen
2019
* @param int $x
2120
* @param int $y
2221
*/

0 commit comments

Comments
 (0)