upgraded dependencies
This commit is contained in:
@@ -113,7 +113,7 @@ class ChoiceFormField extends FormField
|
||||
/**
|
||||
* Sets the value of the field.
|
||||
*
|
||||
* @param string|array|bool $value The value of the field
|
||||
* @param string|array|bool|null $value The value of the field
|
||||
*
|
||||
* @throws \InvalidArgumentException When value type provided is not correct
|
||||
*/
|
||||
@@ -176,7 +176,7 @@ class ChoiceFormField extends FormField
|
||||
/**
|
||||
* Returns the type of the choice field (radio, select, or checkbox).
|
||||
*
|
||||
* @return string The type
|
||||
* @return string
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
@@ -186,7 +186,7 @@ class ChoiceFormField extends FormField
|
||||
/**
|
||||
* Returns true if the field accepts multiple values.
|
||||
*
|
||||
* @return bool true if the field accepts multiple values, false otherwise
|
||||
* @return bool
|
||||
*/
|
||||
public function isMultiple()
|
||||
{
|
||||
@@ -268,12 +268,11 @@ class ChoiceFormField extends FormField
|
||||
/**
|
||||
* Checks whether given value is in the existing options.
|
||||
*
|
||||
* @param string $optionValue
|
||||
* @param array $options
|
||||
* @internal since Symfony 5.3
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function containsOption($optionValue, $options)
|
||||
public function containsOption(string $optionValue, array $options)
|
||||
{
|
||||
if ($this->validationDisabled) {
|
||||
return true;
|
||||
@@ -291,6 +290,8 @@ class ChoiceFormField extends FormField
|
||||
/**
|
||||
* Returns list of available field options.
|
||||
*
|
||||
* @internal since Symfony 5.3
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function availableOptionValues()
|
||||
@@ -307,7 +308,9 @@ class ChoiceFormField extends FormField
|
||||
/**
|
||||
* Disables the internal validation of the field.
|
||||
*
|
||||
* @return self
|
||||
* @internal since Symfony 5.3
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function disableValidation()
|
||||
{
|
||||
|
@@ -25,7 +25,7 @@ class FileFormField extends FormField
|
||||
*
|
||||
* @throws \InvalidArgumentException When error code doesn't exist
|
||||
*/
|
||||
public function setErrorCode($error)
|
||||
public function setErrorCode(int $error)
|
||||
{
|
||||
$codes = [\UPLOAD_ERR_INI_SIZE, \UPLOAD_ERR_FORM_SIZE, \UPLOAD_ERR_PARTIAL, \UPLOAD_ERR_NO_FILE, \UPLOAD_ERR_NO_TMP_DIR, \UPLOAD_ERR_CANT_WRITE, \UPLOAD_ERR_EXTENSION];
|
||||
if (!\in_array($error, $codes)) {
|
||||
@@ -37,20 +37,16 @@ class FileFormField extends FormField
|
||||
|
||||
/**
|
||||
* Sets the value of the field.
|
||||
*
|
||||
* @param string $value The value of the field
|
||||
*/
|
||||
public function upload($value)
|
||||
public function upload(?string $value)
|
||||
{
|
||||
$this->setValue($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the field.
|
||||
*
|
||||
* @param string|null $value The value of the field
|
||||
*/
|
||||
public function setValue($value)
|
||||
public function setValue(?string $value)
|
||||
{
|
||||
if (null !== $value && is_readable($value)) {
|
||||
$error = \UPLOAD_ERR_OK;
|
||||
@@ -80,10 +76,8 @@ class FileFormField extends FormField
|
||||
|
||||
/**
|
||||
* Sets path to the file as string for simulating HTTP request.
|
||||
*
|
||||
* @param string $path The path to the file
|
||||
*/
|
||||
public function setFilePath($path)
|
||||
public function setFilePath(string $path)
|
||||
{
|
||||
parent::setValue($path);
|
||||
}
|
||||
|
12
vendor/symfony/dom-crawler/Field/FormField.php
vendored
12
vendor/symfony/dom-crawler/Field/FormField.php
vendored
@@ -79,7 +79,7 @@ abstract class FormField
|
||||
/**
|
||||
* Returns the name of the field.
|
||||
*
|
||||
* @return string The name of the field
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
@@ -89,7 +89,7 @@ abstract class FormField
|
||||
/**
|
||||
* Gets the value of the field.
|
||||
*
|
||||
* @return string|array The value of the field
|
||||
* @return string|array|null
|
||||
*/
|
||||
public function getValue()
|
||||
{
|
||||
@@ -98,18 +98,16 @@ abstract class FormField
|
||||
|
||||
/**
|
||||
* Sets the value of the field.
|
||||
*
|
||||
* @param string|array|bool|null $value The value of the field
|
||||
*/
|
||||
public function setValue($value)
|
||||
public function setValue(?string $value)
|
||||
{
|
||||
$this->value = (string) $value;
|
||||
$this->value = $value ?? '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the field should be included in the submitted values.
|
||||
*
|
||||
* @return bool true if the field should be included in the submitted values, false otherwise
|
||||
* @return bool
|
||||
*/
|
||||
public function hasValue()
|
||||
{
|
||||
|
Reference in New Issue
Block a user