Skip to content

Commit

Permalink
Merge pull request #184 from stof/fix_phpstan
Browse files Browse the repository at this point in the history
Fix phpstan job
  • Loading branch information
stof authored Jan 9, 2025
2 parents 207f8a5 + 32dbd12 commit 924553d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
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

0 comments on commit 924553d

Please sign in to comment.