From c0c96e1d3361bbc96810884ad1729926ffcda8ce Mon Sep 17 00:00:00 2001 From: Thomas Landauer Date: Mon, 20 Dec 2021 14:09:40 +0100 Subject: [PATCH] Fixing typehint See https://github.com/Codeception/module-webdriver/pull/82#issuecomment-997427904 Since `string|string[]` is not allowed in PHP 7.4, I added it as docblock. Also added `?`, but I'm not sure if `?string|?string[]` is right. --- src/Codeception/Module/WebDriver.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Codeception/Module/WebDriver.php b/src/Codeception/Module/WebDriver.php index eda7ac8..da62529 100644 --- a/src/Codeception/Module/WebDriver.php +++ b/src/Codeception/Module/WebDriver.php @@ -2620,10 +2620,11 @@ public function waitForElementClickable($element, int $timeout = 10): void * $I->waitForText('foo', 30, '.title'); // secs * ``` * - * @param int $timeout seconds + * @param ?int $timeout seconds + * @param ?string|?string[] $selector * @throws Exception */ - public function waitForText(string $text, int $timeout = 10, string $selector = null): void + public function waitForText(string $text, ?int $timeout = 10, ?mixed $selector = null): void { $message = sprintf( 'Waited for %d secs but text %s still not found',