8000 [Yaml] add types to all arguments by nicolas-grekas · Pull Request #41430 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Yaml] add types to all arguments #41430

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Symfony/Component/Yaml/Dumper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) : '';
Expand Down
6 changes: 1 addition & 5 deletions src/Symfony/Component/Yaml/Inline.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Yaml/Tag/TaggedValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Yaml/Yaml.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
0