package and depencies
This commit is contained in:
13
vendor/symfony/dom-crawler/FormFieldRegistry.php
vendored
13
vendor/symfony/dom-crawler/FormFieldRegistry.php
vendored
@@ -20,9 +20,8 @@ use Symfony\Component\DomCrawler\Field\FormField;
|
||||
*/
|
||||
class FormFieldRegistry
|
||||
{
|
||||
private $fields = [];
|
||||
|
||||
private $base = '';
|
||||
private array $fields = [];
|
||||
private string $base = '';
|
||||
|
||||
/**
|
||||
* Adds a field to the registry.
|
||||
@@ -70,7 +69,7 @@ class FormFieldRegistry
|
||||
*
|
||||
* @throws \InvalidArgumentException if the field does not exist
|
||||
*/
|
||||
public function &get(string $name)
|
||||
public function &get(string $name): FormField|array
|
||||
{
|
||||
$segments = $this->getSegments($name);
|
||||
$target = &$this->fields;
|
||||
@@ -94,7 +93,7 @@ class FormFieldRegistry
|
||||
$this->get($name);
|
||||
|
||||
return true;
|
||||
} catch (\InvalidArgumentException $e) {
|
||||
} catch (\InvalidArgumentException) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -102,11 +101,9 @@ class FormFieldRegistry
|
||||
/**
|
||||
* Set the value of a field based on the fully qualified name and its children.
|
||||
*
|
||||
* @param mixed $value The value
|
||||
*
|
||||
* @throws \InvalidArgumentException if the field does not exist
|
||||
*/
|
||||
public function set(string $name, $value)
|
||||
public function set(string $name, mixed $value)
|
||||
{
|
||||
$target = &$this->get($name);
|
||||
if ((!\is_array($value) && $target instanceof Field\FormField) || $target instanceof Field\ChoiceFormField) {
|
||||
|
Reference in New Issue
Block a user