Skip to content

Commit 2ef0c8a

Browse files
authored
Improved support for Codeception 5/PHP 8 (#52)
1 parent 17a740e commit 2ef0c8a

File tree

2 files changed

+17
-14
lines changed

2 files changed

+17
-14
lines changed

composer.json

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
{
22
"name": "codeception/lib-innerbrowser",
33
"description": "Parent library for all Codeception framework modules and PhpBrowser",
4-
"keywords": [ "codeception" ],
5-
"homepage": "https://codeception.com/",
6-
"type": "library",
74
"license": "MIT",
5+
"type": "library",
6+
"keywords": [
7+
"codeception"
8+
],
89
"authors": [
910
{
1011
"name": "Michael Bodnarchuk",
@@ -15,29 +16,31 @@
1516
"name": "Gintautas Miselis"
1617
}
1718
],
18-
"minimum-stability": "dev",
19+
"homepage": "https://codeception.com/",
1920
"require": {
2021
"php": "^8.0",
2122
"ext-dom": "*",
2223
"ext-json": "*",
2324
"ext-mbstring": "*",
24-
"codeception/codeception": "^5.0.0-alpha1",
25-
"symfony/browser-kit": "^4.4 | ^5.4 | ^6.0",
26-
"symfony/dom-crawler": "^4.4 | ^5.4 | ^6.0"
25+
"codeception/codeception": "dev-5.0-interfaces as 5.0.0",
26+
"symfony/browser-kit": "^4.4 || ^5.4 || ^6.0",
27+
"symfony/dom-crawler": "^4.4 || ^5.4 || ^6.0"
2728
},
2829
"require-dev": {
2930
"codeception/util-universalframework": "dev-master"
3031
},
3132
"conflict": {
3233
"codeception/codeception": "<5.0"
3334
},
35+
"minimum-stability": "dev",
3436
"autoload": {
3537
"classmap": [
3638
"src/"
3739
]
3840
},
3941
"config": {
40-
"classmap-authoritative": true
42+
"classmap-authoritative": true,
43+
"sort-packages": true
4144
},
4245
"scripts": {
4346
"test": "codecept run --coverage-xml"

src/Codeception/Lib/InnerBrowser.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public function _conflicts(): string
124124
return \Codeception\Lib\Interfaces\Web::class;
125125
}
126126

127-
public function _findElements($locator)
127+
public function _findElements(mixed $locator): iterable
128128
{
129129
return $this->match($locator);
130130
}
@@ -633,7 +633,7 @@ public function dontSeeCurrentUrlMatches(string $uri): void
633633
$this->assertNotRegExp($uri, $this->_getCurrentUri());
634634
}
635635

636-
public function grabFromCurrentUrl($uri = null)
636+
public function grabFromCurrentUrl(string $uri = null): mixed
637637
{
638638
if (!$uri) {
639639
return $this->_getCurrentUri();
@@ -1475,7 +1475,7 @@ protected function filterByAttributes(Crawler $nodes, array $attributes)
14751475
return $nodes;
14761476
}
14771477

1478-
public function grabTextFrom($cssOrXPathOrRegex)
1478+
public function grabTextFrom($cssOrXPathOrRegex): mixed
14791479
{
14801480
if (is_string($cssOrXPathOrRegex) && @preg_match($cssOrXPathOrRegex, $this->client->getInternalResponse()->getContent(), $matches)) {
14811481
return $matches[1];
@@ -1489,7 +1489,7 @@ public function grabTextFrom($cssOrXPathOrRegex)
14891489
throw new ElementNotFound($cssOrXPathOrRegex, 'Element that matches CSS or XPath or Regex');
14901490
}
14911491

1492-
public function grabAttributeFrom($cssOrXpath, $attribute)
1492+
public function grabAttributeFrom($cssOrXpath, string $attribute): mixed
14931493
{
14941494
$nodes = $this->match($cssOrXpath);
14951495
if ($nodes->count() === 0) {
@@ -1511,7 +1511,7 @@ public function grabMultiple($cssOrXpath, string $attribute = null): array
15111511
return $result;
15121512
}
15131513

1514-
public function grabValueFrom($field)
1514+
public function grabValueFrom($field): mixed
15151515
{
15161516
$nodes = $this->match($field);
15171517
if ($nodes->count() === 0) {
@@ -1566,7 +1566,7 @@ public function setCookie($name, $val, $params = [])
15661566
$this->debugCookieJar();
15671567
}
15681568

1569-
public function grabCookie($cookie, $params = [])
1569+
public function grabCookie(string $cookie, array $params = []): mixed
15701570
{
15711571
$params = array_merge($this->defaultCookieParameters, $params);
15721572
$this->debugCookieJar();

0 commit comments

Comments
 (0)