Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 6cbca1e

Browse filesBrowse files
minor #41430 [Yaml] add types to all arguments (nicolas-grekas)
This PR was merged into the 6.0 branch. Discussion ---------- [Yaml] add types to all arguments | Q | A | ------------- | --- | Branch? | 6.0 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Extracted from #41424 Commits ------- 129411e [Yaml] add types to all arguments
2 parents 9dc4ef3 + 129411e commit 6cbca1e
Copy full SHA for 6cbca1e

File tree

4 files changed

+4
-8
lines changed
Filter options

4 files changed

+4
-8
lines changed

‎src/Symfony/Component/Yaml/Dumper.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Yaml/Dumper.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function __construct(int $indentation = 4)
4848
*
4949
* @return string The YAML representation of the PHP value
5050
*/
51-
public function dump($input, int $inline = 0, int $indent = 0, int $flags = 0): string
51+
public function dump(mixed $input, int $inline = 0, int $indent = 0, int $flags = 0): string
5252
{
5353
$output = '';
5454
$prefix = $indent ? str_repeat(' ', $indent) : '';

‎src/Symfony/Component/Yaml/Inline.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Yaml/Inline.php
+1-5Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -200,12 +200,8 @@ public static function dump($value, int $flags = 0): string
200200

201201
/**
202202
* Check if given array is hash or just normal indexed array.
203-
*
204-
* @param array|\ArrayObject|\stdClass $value The PHP array or array-like object to check
205-
*
206-
* @return bool true if value is hash array, false otherwise
207203
*/
208-
public static function isHash($value): bool
204+
public static function isHash(array|\ArrayObject|\stdClass $value): bool
209205
{
210206
if ($value instanceof \stdClass || $value instanceof \ArrayObject) {
211207
return true;

‎src/Symfony/Component/Yaml/Tag/TaggedValue.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Yaml/Tag/TaggedValue.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ final class TaggedValue
2020
private $tag;
2121
private $value;
2222

23-
public function __construct(string $tag, $value)
23+
public function __construct(string $tag, mixed $value)
2424
{
2525
$this->tag = $tag;
2626
$this->value = $value;

‎src/Symfony/Component/Yaml/Yaml.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Yaml/Yaml.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public static function parse(string $input, int $flags = 0)
9393
*
9494
* @return string A YAML string representing the original PHP value
9595
*/
96-
public static function dump($input, int $inline = 2, int $indent = 4, int $flags = 0): string
96+
public static function dump(mixed $input, int $inline = 2, int $indent = 4, int $flags = 0): string
9797
{
9898
$yaml = new Dumper($indent);
9999

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.