Skip to content

Commit 14a66d3

Browse files
committed
Add more precise types for the Yaml flags
1 parent 412589d commit 14a66d3

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

Dumper.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ public function __construct(int $indentation = 4)
3939
/**
4040
* Dumps a PHP value to YAML.
4141
*
42-
* @param mixed $input The PHP value
43-
* @param int $inline The level where you switch to inline YAML
44-
* @param int $indent The level of indentation (used internally)
45-
* @param int $flags A bit field of Yaml::DUMP_* constants to customize the dumped YAML string
42+
* @param mixed $input The PHP value
43+
* @param int $inline The level where you switch to inline YAML
44+
* @param int $indent The level of indentation (used internally)
45+
* @param int-mask-of<Yaml::DUMP_*> $flags A bit field of Yaml::DUMP_* constants to customize the dumped YAML string
4646
*/
4747
public function dump(mixed $input, int $inline = 0, int $indent = 0, int $flags = 0): string
4848
{

Parser.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ class Parser
4242
/**
4343
* Parses a YAML file into a PHP value.
4444
*
45-
* @param string $filename The path to the YAML file to be parsed
46-
* @param int $flags A bit field of Yaml::PARSE_* constants to customize the YAML parser behavior
45+
* @param string $filename The path to the YAML file to be parsed
46+
* @param int-mask-of<Yaml::PARSE_*> $flags A bit field of Yaml::PARSE_* constants to customize the YAML parser behavior
4747
*
4848
* @throws ParseException If the file could not be read or the YAML is not valid
4949
*/
@@ -69,8 +69,8 @@ public function parseFile(string $filename, int $flags = 0): mixed
6969
/**
7070
* Parses a YAML string to a PHP value.
7171
*
72-
* @param string $value A YAML string
73-
* @param int $flags A bit field of Yaml::PARSE_* constants to customize the YAML parser behavior
72+
* @param string $value A YAML string
73+
* @param int-mask-of<Yaml::PARSE_*> $flags A bit field of Yaml::PARSE_* constants to customize the YAML parser behavior
7474
*
7575
* @throws ParseException If the YAML is not valid
7676
*/

Yaml.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ class Yaml
4444
* $array = Yaml::parseFile('config.yml');
4545
* print_r($array);
4646
*
47-
* @param string $filename The path to the YAML file to be parsed
48-
* @param int $flags A bit field of PARSE_* constants to customize the YAML parser behavior
47+
* @param string $filename The path to the YAML file to be parsed
48+
* @param int-mask-of<self::PARSE_*> $flags A bit field of PARSE_* constants to customize the YAML parser behavior
4949
*
5050
* @throws ParseException If the file could not be read or the YAML is not valid
5151
*/
@@ -65,8 +65,8 @@ public static function parseFile(string $filename, int $flags = 0): mixed
6565
* print_r($array);
6666
* </code>
6767
*
68-
* @param string $input A string containing YAML
69-
* @param int $flags A bit field of PARSE_* constants to customize the YAML parser behavior
68+
* @param string $input A string containing YAML
69+
* @param int-mask-of<self::PARSE_*> $flags A bit field of PARSE_* constants to customize the YAML parser behavior
7070
*
7171
* @throws ParseException If the YAML is not valid
7272
*/
@@ -83,10 +83,10 @@ public static function parse(string $input, int $flags = 0): mixed
8383
* The dump method, when supplied with an array, will do its best
8484
* to convert the array into friendly YAML.
8585
*
86-
* @param mixed $input The PHP value
87-
* @param int $inline The level where you switch to inline YAML
88-
* @param int $indent The amount of spaces to use for indentation of nested nodes
89-
* @param int $flags A bit field of DUMP_* constants to customize the dumped YAML string
86+
* @param mixed $input The PHP value
87+
* @param int $inline The level where you switch to inline YAML
88+
* @param int $indent The amount of spaces to use for indentation of nested nodes
89+
* @param int-mask-of<self::DUMP_*> $flags A bit field of DUMP_* constants to customize the dumped YAML string
9090
*/
9191
public static function dump(mixed $input, int $inline = 2, int $indent = 4, int $flags = 0): string
9292
{

0 commit comments

Comments
 (0)