Skip to content

Commit 31d379e

Browse files
committed
Problematic changes
1 parent 7b341ab commit 31d379e

File tree

6 files changed

+8
-27
lines changed

6 files changed

+8
-27
lines changed

src/Client.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -190,11 +190,7 @@ public function setServerParameter($key, $value): void
190190
throw new \InvalidArgumentException('Server parameters cannot be set when using WebDriver.');
191191
}
192192

193-
/**
194-
* @return mixed
195-
*/
196-
#[\ReturnTypeWillChange]
197-
public function getServerParameter($key, $default = '')
193+
public function getServerParameter($key, $default = ''): mixed
198194
{
199195
throw new \InvalidArgumentException('Server parameters cannot be retrieved when using WebDriver.');
200196
}

src/DomCrawler/Field/ChoiceFormField.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,7 @@ public function untick(): void
7979
$this->setValue(false);
8080
}
8181

82-
/**
83-
* @return string|string[]|null
84-
*/
85-
#[\ReturnTypeWillChange]
86-
public function getValue()
82+
public function getValue(): array|string|null
8783
{
8884
$type = $this->element->getAttribute('type');
8985

src/DomCrawler/Field/FileFormField.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,7 @@ final class FileFormField extends BaseFileFormField
2727
*/
2828
protected $value;
2929

30-
/**
31-
* @return string|string[]|null
32-
*/
33-
#[\ReturnTypeWillChange]
34-
public function getValue()
30+
public function getValue(): array|string|null
3531
{
3632
return $this->value;
3733
}

src/DomCrawler/Field/FormFieldTrait.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,7 @@ public function getName(): string
4444
return $this->element->getAttribute('name') ?? '';
4545
}
4646

47-
/**
48-
* @return string|string[]|null
49-
*/
50-
#[\ReturnTypeWillChange]
51-
public function getValue()
47+
public function getValue(): array|string|null
5248
{
5349
return $this->element->getAttribute('value');
5450
}

src/DomCrawler/Form.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,7 @@ public function set(FormField $field): void
215215
/**
216216
* @return FormField|FormField[]|FormField[][]
217217
*/
218-
#[\ReturnTypeWillChange]
219-
public function get($name)
218+
public function get($name): FormField|array
220219
{
221220
return $this->getFormField($this->getFormElement($name));
222221
}
@@ -243,8 +242,7 @@ public function offsetExists($name): bool
243242
*
244243
* @return FormField|FormField[]|FormField[][]
245244
*/
246-
#[\ReturnTypeWillChange]
247-
public function offsetGet($name)
245+
public function offsetGet($name): FormField|array
248246
{
249247
return $this->get($name);
250248
}

src/WebTestAssertionsTrait.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
use Facebook\WebDriver\WebDriverElement;
1717
use Symfony\Bundle\FrameworkBundle\KernelBrowser;
1818
use Symfony\Bundle\FrameworkBundle\Test\WebTestAssertionsTrait as BaseWebTestAssertionsTrait;
19-
use Symfony\Component\BrowserKit\AbstractBrowser;
2019
use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;
2120
use Symfony\Component\Panther\Client as PantherClient;
2221

@@ -275,9 +274,9 @@ private static function findElement(string $locator): WebDriverElement
275274
* @param array $options An array of options to pass to the createKernel method
276275
* @param array $server An array of server parameters
277276
*
278-
* @return AbstractBrowser A browser instance
277+
* @return KernelBrowser A browser instance
279278
*/
280-
protected static function createClient(array $options = [], array $server = []): AbstractBrowser
279+
protected static function createClient(array $options = [], array $server = []): KernelBrowser
281280
{
282281
$kernel = static::bootKernel($options);
283282

0 commit comments

Comments
 (0)