diff --git a/src/Symfony/Component/Yaml/Dumper.php b/src/Symfony/Component/Yaml/Dumper.php index dcb104ccff065..2cbae238cc059 100644 --- a/src/Symfony/Component/Yaml/Dumper.php +++ b/src/Symfony/Component/Yaml/Dumper.php @@ -48,7 +48,7 @@ public function __construct(int $indentation = 4) * * @return string The YAML representation of the PHP value */ - public function dump($input, int $inline = 0, int $indent = 0, int $flags = 0): string + public function dump(mixed $input, int $inline = 0, int $indent = 0, int $flags = 0): string { $output = ''; $prefix = $indent ? str_repeat(' ', $indent) : ''; diff --git a/src/Symfony/Component/Yaml/Inline.php b/src/Symfony/Component/Yaml/Inline.php index 349ed6c94e727..4e7645022bbfa 100644 --- a/src/Symfony/Component/Yaml/Inline.php +++ b/src/Symfony/Component/Yaml/Inline.php @@ -200,12 +200,8 @@ public static function dump($value, int $flags = 0): string /** * Check if given array is hash or just normal indexed array. - * - * @param array|\ArrayObject|\stdClass $value The PHP array or array-like object to check - * - * @return bool true if value is hash array, false otherwise */ - public static function isHash($value): bool + public static function isHash(array|\ArrayObject|\stdClass $value): bool { if ($value instanceof \stdClass || $value instanceof \ArrayObject) { return true; diff --git a/src/Symfony/Component/Yaml/Tag/TaggedValue.php b/src/Symfony/Component/Yaml/Tag/TaggedValue.php index 4ea3406135999..55676ac785106 100644 --- a/src/Symfony/Component/Yaml/Tag/TaggedValue.php +++ b/src/Symfony/Component/Yaml/Tag/TaggedValue.php @@ -20,7 +20,7 @@ final class TaggedValue private $tag; private $value; - public function __construct(string $tag, $value) + public function __construct(string $tag, mixed $value) { $this->tag = $tag; $this->value = $value; diff --git a/src/Symfony/Component/Yaml/Yaml.php b/src/Symfony/Component/Yaml/Yaml.php index 4fea47f9a7488..2664684c38fa2 100644 --- a/src/Symfony/Component/Yaml/Yaml.php +++ b/src/Symfony/Component/Yaml/Yaml.php @@ -93,7 +93,7 @@ public static function parse(string $input, int $flags = 0) * * @return string A YAML string representing the original PHP value */ - public static function dump($input, int $inline = 2, int $indent = 4, int $flags = 0): string + public static function dump(mixed $input, int $inline = 2, int $indent = 4, int $flags = 0): string { $yaml = new Dumper($indent);