package and depencies

This commit is contained in:
RafficMohammed
2023-01-08 02:57:24 +05:30
parent d5332eb421
commit 1d54b8bc7f
4309 changed files with 193331 additions and 172289 deletions

View File

@@ -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) {