Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},

"require-dev": {
"phpstan/phpstan": "^1.10",
"phpstan/phpstan": "^1.12.32",
"phpstan/phpstan-phpunit": "^1.3",
"phpunit/phpunit": "^8.5.22 || ^9.5.11",
"symfony/error-handler": "^4.4 || ^5.0 || ^6.0 || ^7.0",
Expand Down
7 changes: 6 additions & 1 deletion phpstan.dist.neon
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,18 @@ parameters:
paths:
- src
- tests
checkMissingIterableValueType: false
checkMissingCallableSignature: true
treatPhpDocTypesAsCertain: false
ignoreErrors:
- '#^Method Behat\\Mink\\Tests\\[^:]+Test(Case)?\:\:test\w*\(\) has no return type specified\.$#'
- '#^Method Behat\\Mink\\Tests\\[^:]+Test(Case)?\:\:provide\w*\(\) has no return type specified\.$#'
- '#^Method Behat\\Mink\\Tests\\[^:]+Test(Case)?\:\:get\w*\(\) has no return type specified\.$#'
-
message: '#^Method Behat\\Mink\\[^:]+\:\:\w+\(\) has parameter \$selector with no value type specified in iterable type array\.$#'
identifier: missingType.iterableValue
-
message: '#^Method Behat\\Mink\\[^:]+\:\:\w+\(\) has parameter \$locator with no value type specified in iterable type array\.$#'
identifier: missingType.iterableValue

includes:
- vendor/phpstan/phpstan-phpunit/extension.neon
Expand Down
4 changes: 4 additions & 0 deletions src/Driver/CoreDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,8 @@ public function getAttribute(string $xpath, string $name)
*
* @return string|bool|array|null
*
* @phpstan-return string|bool|list<string>|null
*
* @throws UnsupportedDriverActionException When operation not supported by the driver
* @throws DriverException When the operation cannot be done
*/
Expand All @@ -400,6 +402,8 @@ public function getValue(string $xpath)
* @param string $xpath
* @param string|bool|array $value
*
* @phpstan-param string|bool|list<string> $value
*
* @return void
*
* @throws UnsupportedDriverActionException When operation not supported by the driver
Expand Down
4 changes: 4 additions & 0 deletions src/Driver/DriverInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,8 @@ public function getAttribute(
*
* @return string|bool|array|null
*
* @phpstan-return string|bool|list<string>|null
*
* @throws UnsupportedDriverActionException When operation not supported by the driver
* @throws DriverException When the operation cannot be done
*/
Expand All @@ -412,6 +414,8 @@ public function getValue(
* @param string $xpath
* @param string|bool|array $value
*
* @phpstan-param string|bool|list<string> $value
*
* @return void
*
* @throws UnsupportedDriverActionException When operation not supported by the driver
Expand Down
4 changes: 4 additions & 0 deletions src/Element/NodeElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ public function getTagName()
* Calling this method on other elements than form fields or option elements is not allowed.
*
* @return string|bool|array|null
*
* @phpstan-return string|bool|list<string>|null
*/
public function getValue()
{
Expand All @@ -109,6 +111,8 @@ public function getValue()
*
* @param string|bool|array $value
*
* @phpstan-param string|bool|list<string> $value
*
* @return void
*
* @see NodeElement::getValue for the format of the value for each type of field
Expand Down
2 changes: 2 additions & 0 deletions src/Element/TraversableElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ public function findField(string $locator)
* @param string $locator input id, name or label
* @param string|bool|array $value value
*
* @phpstan-param string|bool|list<string> $value
*
* @return void
*
* @throws ElementNotFoundException
Expand Down
2 changes: 2 additions & 0 deletions tests/SessionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ public function testGetResponseHeaders()
}

/**
* @param array<string, string|list<string>> $headers
*
* @dataProvider provideResponseHeader
*/
public function testGetResponseHeader(?string $expected, string $name, array $headers)
Expand Down