Skip to content

Fix phpstan job #184

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 9, 2025
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 phpstan.dist.neon
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ parameters:
paths:
- src
- tests
checkMissingIterableValueType: false
ignoreErrors:
- identifier: missingType.iterableValue # TODO remove this ignore rule once DriverInterface defines the appropriate value types
- '#^Method Behat\\Mink\\Tests\\Driver\\Custom\\[^:]+Test(Case)?\:\:test\w*\(\) has no return type specified\.$#'

includes:
Expand Down
10 changes: 7 additions & 3 deletions src/BrowserKitDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,14 @@
* Symfony BrowserKit driver.
*
* @author Konstantin Kudryashov <[email protected]>
*
* @template TRequest of object
* @template TResponse of object
*/
class BrowserKitDriver extends CoreDriver
{
/**
* @var AbstractBrowser
* @var AbstractBrowser<TRequest, TResponse>
*/
private $client;

Expand All @@ -52,7 +55,8 @@ class BrowserKitDriver extends CoreDriver
/**
* Initializes BrowserKit driver.
*
* @param string|null $baseUrl Base URL for HttpKernel clients
* @param AbstractBrowser<TRequest, TResponse> $client
* @param string|null $baseUrl Base URL for HttpKernel clients
*/
public function __construct(AbstractBrowser $client, ?string $baseUrl = null)
{
Expand All @@ -71,7 +75,7 @@ public function __construct(AbstractBrowser $client, ?string $baseUrl = null)
/**
* Returns BrowserKit browser instance.
*
* @return AbstractBrowser
* @return AbstractBrowser<TRequest, TResponse>
*/
public function getClient()
{
Expand Down
6 changes: 6 additions & 0 deletions tests/Custom/ErrorHandlingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,18 @@ public function testClickOnUnsupportedElement()
$driver->click('//div');
}

/**
* @return BrowserKitDriver<object, Response>
*/
private function getDriver(): BrowserKitDriver
{
return new BrowserKitDriver($this->client);
}
}

/**
* @template-extends AbstractBrowser<object, Response>
*/
class TestClient extends AbstractBrowser
{
/**
Expand Down
Loading