diff --git a/phpstan.dist.neon b/phpstan.dist.neon index f7cbf4c..ee53bf8 100644 --- a/phpstan.dist.neon +++ b/phpstan.dist.neon @@ -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: diff --git a/src/BrowserKitDriver.php b/src/BrowserKitDriver.php index 06b7fce..6731f2e 100644 --- a/src/BrowserKitDriver.php +++ b/src/BrowserKitDriver.php @@ -28,11 +28,14 @@ * Symfony BrowserKit driver. * * @author Konstantin Kudryashov + * + * @template TRequest of object + * @template TResponse of object */ class BrowserKitDriver extends CoreDriver { /** - * @var AbstractBrowser + * @var AbstractBrowser */ private $client; @@ -52,7 +55,8 @@ class BrowserKitDriver extends CoreDriver /** * Initializes BrowserKit driver. * - * @param string|null $baseUrl Base URL for HttpKernel clients + * @param AbstractBrowser $client + * @param string|null $baseUrl Base URL for HttpKernel clients */ public function __construct(AbstractBrowser $client, ?string $baseUrl = null) { @@ -71,7 +75,7 @@ public function __construct(AbstractBrowser $client, ?string $baseUrl = null) /** * Returns BrowserKit browser instance. * - * @return AbstractBrowser + * @return AbstractBrowser */ public function getClient() { diff --git a/tests/Custom/ErrorHandlingTest.php b/tests/Custom/ErrorHandlingTest.php index 19ba56d..e2af817 100644 --- a/tests/Custom/ErrorHandlingTest.php +++ b/tests/Custom/ErrorHandlingTest.php @@ -154,12 +154,18 @@ public function testClickOnUnsupportedElement() $driver->click('//div'); } + /** + * @return BrowserKitDriver + */ private function getDriver(): BrowserKitDriver { return new BrowserKitDriver($this->client); } } +/** + * @template-extends AbstractBrowser + */ class TestClient extends AbstractBrowser { /**