Skip to content

Commit 3b0ac4d

Browse files
[Yaml] add types to all arguments
1 parent f7e9a51 commit 3b0ac4d

File tree

4 files changed

+4
-8
lines changed

4 files changed

+4
-8
lines changed

Dumper.php

Lines 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) : '';

Inline.php

Lines 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;

Tag/TaggedValue.php

Lines 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;

Yaml.php

Lines 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)