diff --git a/composer.json b/composer.json index f860bf8..ab3361b 100644 --- a/composer.json +++ b/composer.json @@ -1,10 +1,11 @@ { "name": "codeception/lib-innerbrowser", "description": "Parent library for all Codeception framework modules and PhpBrowser", - "keywords": [ "codeception" ], - "homepage": "https://codeception.com/", - "type": "library", "license": "MIT", + "type": "library", + "keywords": [ + "codeception" + ], "authors": [ { "name": "Michael Bodnarchuk", @@ -15,15 +16,15 @@ "name": "Gintautas Miselis" } ], - "minimum-stability": "dev", + "homepage": "https://codeception.com/", "require": { "php": "^8.0", "ext-dom": "*", "ext-json": "*", "ext-mbstring": "*", - "codeception/codeception": "^5.0.0-alpha1", - "symfony/browser-kit": "^4.4 | ^5.4 | ^6.0", - "symfony/dom-crawler": "^4.4 | ^5.4 | ^6.0" + "codeception/codeception": "dev-5.0-interfaces as 5.0.0", + "symfony/browser-kit": "^4.4 || ^5.4 || ^6.0", + "symfony/dom-crawler": "^4.4 || ^5.4 || ^6.0" }, "require-dev": { "codeception/util-universalframework": "dev-master" @@ -31,13 +32,15 @@ "conflict": { "codeception/codeception": "<5.0" }, + "minimum-stability": "dev", "autoload": { "classmap": [ "src/" ] }, "config": { - "classmap-authoritative": true + "classmap-authoritative": true, + "sort-packages": true }, "scripts": { "test": "codecept run --coverage-xml" diff --git a/src/Codeception/Lib/InnerBrowser.php b/src/Codeception/Lib/InnerBrowser.php index 092af34..788d765 100644 --- a/src/Codeception/Lib/InnerBrowser.php +++ b/src/Codeception/Lib/InnerBrowser.php @@ -124,7 +124,7 @@ public function _conflicts(): string return \Codeception\Lib\Interfaces\Web::class; } - public function _findElements($locator) + public function _findElements(mixed $locator): iterable { return $this->match($locator); } @@ -633,7 +633,7 @@ public function dontSeeCurrentUrlMatches(string $uri): void $this->assertNotRegExp($uri, $this->_getCurrentUri()); } - public function grabFromCurrentUrl($uri = null) + public function grabFromCurrentUrl(string $uri = null): mixed { if (!$uri) { return $this->_getCurrentUri(); @@ -1475,7 +1475,7 @@ protected function filterByAttributes(Crawler $nodes, array $attributes) return $nodes; } - public function grabTextFrom($cssOrXPathOrRegex) + public function grabTextFrom($cssOrXPathOrRegex): mixed { if (is_string($cssOrXPathOrRegex) && @preg_match($cssOrXPathOrRegex, $this->client->getInternalResponse()->getContent(), $matches)) { return $matches[1]; @@ -1489,7 +1489,7 @@ public function grabTextFrom($cssOrXPathOrRegex) throw new ElementNotFound($cssOrXPathOrRegex, 'Element that matches CSS or XPath or Regex'); } - public function grabAttributeFrom($cssOrXpath, $attribute) + public function grabAttributeFrom($cssOrXpath, string $attribute): mixed { $nodes = $this->match($cssOrXpath); if ($nodes->count() === 0) { @@ -1511,7 +1511,7 @@ public function grabMultiple($cssOrXpath, string $attribute = null): array return $result; } - public function grabValueFrom($field) + public function grabValueFrom($field): mixed { $nodes = $this->match($field); if ($nodes->count() === 0) { @@ -1566,7 +1566,7 @@ public function setCookie($name, $val, $params = []) $this->debugCookieJar(); } - public function grabCookie($cookie, $params = []) + public function grabCookie(string $cookie, array $params = []): mixed { $params = array_merge($this->defaultCookieParameters, $params); $this->debugCookieJar();