Skip to content

Commit

Permalink
Problematic changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jordisala1991 committed Oct 30, 2021
1 parent 5f40691 commit dfc9c94
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 16 deletions.
6 changes: 1 addition & 5 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,7 @@ public function setServerParameter($key, $value): void
throw new \InvalidArgumentException('Server parameters cannot be set when using WebDriver.');
}

/**
* @return mixed
*/
#[\ReturnTypeWillChange]
public function getServerParameter($key, $default = '')
public function getServerParameter($key, $default = ''): mixed
{
throw new \InvalidArgumentException('Server parameters cannot be retrieved when using WebDriver.');
}
Expand Down
6 changes: 1 addition & 5 deletions src/DomCrawler/Field/ChoiceFormField.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,7 @@ public function untick(): void
$this->setValue(false);
}

/**
* @return string|string[]|null
*/
#[\ReturnTypeWillChange]
public function getValue()
public function getValue(): string|array|null
{
$type = $this->element->getAttribute('type');

Expand Down
2 changes: 1 addition & 1 deletion src/DomCrawler/Field/FormFieldTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function getName(): string
/**
* @return string|array|null
*/
public function getValue()
public function getValue(): array|string|null
{
return $this->element->getAttribute('value');
}
Expand Down
4 changes: 2 additions & 2 deletions src/DomCrawler/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ public function set(FormField $field): void
* @return FormField|FormField[]|FormField[][]
*/
#[\ReturnTypeWillChange]
public function get($name)
public function get($name): FormField|array
{
return $this->getFormField($this->getFormElement($name));
}
Expand Down Expand Up @@ -244,7 +244,7 @@ public function offsetExists($name): bool
* @return FormField|FormField[]|FormField[][]
*/
#[\ReturnTypeWillChange]
public function offsetGet($name)
public function offsetGet($name): FormField|array
{
return $this->get($name);
}
Expand Down
5 changes: 2 additions & 3 deletions src/WebTestAssertionsTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
use Facebook\WebDriver\WebDriverElement;
use Symfony\Bundle\FrameworkBundle\KernelBrowser;
use Symfony\Bundle\FrameworkBundle\Test\WebTestAssertionsTrait as BaseWebTestAssertionsTrait;
use Symfony\Component\BrowserKit\AbstractBrowser;
use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;
use Symfony\Component\Panther\Client as PantherClient;

Expand Down Expand Up @@ -275,9 +274,9 @@ private static function findElement(string $locator): WebDriverElement
* @param array $options An array of options to pass to the createKernel method
* @param array $server An array of server parameters
*
* @return AbstractBrowser A browser instance
* @return KernelBrowser A browser instance
*/
protected static function createClient(array $options = [], array $server = []): AbstractBrowser
protected static function createClient(array $options = [], array $server = []): KernelBrowser
{
$kernel = static::bootKernel($options);

Expand Down

0 comments on commit dfc9c94

Please sign in to comment.