Skip to content

Commit 9cb8298

Browse files
Cleanup more @return annotations
1 parent 2b3a8e5 commit 9cb8298

File tree

7 files changed

+19
-47
lines changed

7 files changed

+19
-47
lines changed

Dumper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function __construct(int $indentation = 4)
4646
* @param int $indent The level of indentation (used internally)
4747
* @param int $flags A bit field of Yaml::DUMP_* constants to customize the dumped YAML string
4848
*
49-
* @return string The YAML representation of the PHP value
49+
* @return string
5050
*/
5151
public function dump($input, int $inline = 0, int $indent = 0, int $flags = 0): string
5252
{

Escaper.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ class Escaper
4949
* Determines if a PHP value would require double quoting in YAML.
5050
*
5151
* @param string $value A PHP value
52-
*
53-
* @return bool True if the value would require double quotes
5452
*/
5553
public static function requiresDoubleQuoting(string $value): bool
5654
{
@@ -61,8 +59,6 @@ public static function requiresDoubleQuoting(string $value): bool
6159
* Escapes and surrounds a PHP value with double quotes.
6260
*
6361
* @param string $value A PHP value
64-
*
65-
* @return string The quoted, escaped string
6662
*/
6763
public static function escapeWithDoubleQuotes(string $value): string
6864
{
@@ -73,8 +69,6 @@ public static function escapeWithDoubleQuotes(string $value): string
7369
* Determines if a PHP value would require single quoting in YAML.
7470
*
7571
* @param string $value A PHP value
76-
*
77-
* @return bool True if the value would require single quotes
7872
*/
7973
public static function requiresSingleQuoting(string $value): bool
8074
{
@@ -93,8 +87,6 @@ public static function requiresSingleQuoting(string $value): bool
9387
* Escapes and surrounds a PHP value with single quotes.
9488
*
9589
* @param string $value A PHP value
96-
*
97-
* @return string The quoted, escaped string
9890
*/
9991
public static function escapeWithSingleQuotes(string $value): string
10092
{

Exception/ParseException.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function __construct(string $message, int $parsedLine = -1, string $snipp
4444
/**
4545
* Gets the snippet of code near the error.
4646
*
47-
* @return string The snippet of code
47+
* @return string
4848
*/
4949
public function getSnippet()
5050
{
@@ -66,7 +66,7 @@ public function setSnippet(string $snippet)
6666
*
6767
* This method returns null if a string is parsed.
6868
*
69-
* @return string The filename
69+
* @return string
7070
*/
7171
public function getParsedFile()
7272
{
@@ -86,7 +86,7 @@ public function setParsedFile(string $parsedFile)
8686
/**
8787
* Gets the line where the error occurred.
8888
*
89-
* @return int The file line
89+
* @return int
9090
*/
9191
public function getParsedLine()
9292
{

Inline.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public static function initialize(int $flags, int $parsedLineNumber = null, stri
5454
* @param int $flags A bit field of PARSE_* constants to customize the YAML parser behavior
5555
* @param array $references Mapping of variable names to values
5656
*
57-
* @return mixed A PHP value
57+
* @return mixed
5858
*
5959
* @throws ParseException
6060
*/
@@ -112,7 +112,7 @@ public static function parse(string $value = null, int $flags = 0, array &$refer
112112
* @param mixed $value The PHP variable to convert
113113
* @param int $flags A bit field of Yaml::DUMP_* constants to customize the dumped YAML string
114114
*
115-
* @return string The YAML string representing the PHP value
115+
* @return string
116116
*
117117
* @throws DumpException When trying to dump PHP resource
118118
*/
@@ -205,7 +205,7 @@ public static function dump($value, int $flags = 0): string
205205
*
206206
* @param array|\ArrayObject|\stdClass $value The PHP array or array-like object to check
207207
*
208-
* @return bool true if value is hash array, false otherwise
208+
* @return bool
209209
*/
210210
public static function isHash($value): bool
211211
{
@@ -218,7 +218,7 @@ public static function isHash($value): bool
218218
* @param array $value The PHP array to dump
219219
* @param int $flags A bit field of Yaml::DUMP_* constants to customize the dumped YAML string
220220
*
221-
* @return string The YAML string representing the PHP array
221+
* @return string
222222
*/
223223
private static function dumpArray(array $value, int $flags): string
224224
{
@@ -544,7 +544,7 @@ private static function parseMapping(string $mapping, int $flags, int &$i = 0, a
544544
/**
545545
* Evaluates scalars and replaces magic values.
546546
*
547-
* @return mixed The evaluated YAML string
547+
* @return mixed
548548
*
549549
* @throws ParseException when object parsing support was disabled and the parser detected a PHP object or when a reference could not be resolved
550550
*/
@@ -767,7 +767,7 @@ private static function isBinaryString(string $value): bool
767767
/**
768768
* Gets a regex that matches a YAML date.
769769
*
770-
* @return string The regular expression
770+
* @return string
771771
*
772772
* @see http://www.yaml.org/spec/1.2/spec.html#id2761573
773773
*/

Parser.php

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class Parser
4545
* @param string $filename The path to the YAML file to be parsed
4646
* @param int $flags A bit field of PARSE_* constants to customize the YAML parser behavior
4747
*
48-
* @return mixed The YAML converted to a PHP value
48+
* @return mixed
4949
*
5050
* @throws ParseException If the file could not be read or the YAML is not valid
5151
*/
@@ -74,7 +74,7 @@ public function parseFile(string $filename, int $flags = 0)
7474
* @param string $value A YAML string
7575
* @param int $flags A bit field of PARSE_* constants to customize the YAML parser behavior
7676
*
77-
* @return mixed A PHP value
77+
* @return mixed
7878
*
7979
* @throws ParseException If the YAML is not valid
8080
*/
@@ -539,8 +539,6 @@ private function parseBlock(int $offset, string $yaml, int $flags)
539539
* Returns the current line number (takes the offset into account).
540540
*
541541
* @internal
542-
*
543-
* @return int The current line number
544542
*/
545543
public function getRealCurrentLineNb(): int
546544
{
@@ -559,8 +557,6 @@ public function getRealCurrentLineNb(): int
559557

560558
/**
561559
* Returns the current line indentation.
562-
*
563-
* @return int The current line indentation
564560
*/
565561
private function getCurrentLineIndentation(): int
566562
{
@@ -577,8 +573,6 @@ private function getCurrentLineIndentation(): int
577573
* @param int|null $indentation The indent level at which the block is to be read, or null for default
578574
* @param bool $inSequence True if the enclosing data structure is a sequence
579575
*
580-
* @return string A YAML string
581-
*
582576
* @throws ParseException When indentation problem are detected
583577
*/
584578
private function getNextEmbedBlock(int $indentation = null, bool $inSequence = false): string
@@ -718,7 +712,7 @@ private function moveToPreviousLine(): bool
718712
* @param int $flags A bit field of PARSE_* constants to customize the YAML parser behavior
719713
* @param string $context The parser context (either sequence or mapping)
720714
*
721-
* @return mixed A PHP value
715+
* @return mixed
722716
*
723717
* @throws ParseException When reference does not exist
724718
*/
@@ -938,8 +932,6 @@ private function parseBlockScalar(string $style, string $chomping = '', int $ind
938932

939933
/**
940934
* Returns true if the next line is indented.
941-
*
942-
* @return bool Returns true if the next line is indented, false otherwise
943935
*/
944936
private function isNextLineIndented(): bool
945937
{
@@ -969,8 +961,6 @@ private function isNextLineIndented(): bool
969961

970962
/**
971963
* Returns true if the current line is blank or if it is a comment line.
972-
*
973-
* @return bool Returns true if the current line is empty or if it is a comment line, false otherwise
974964
*/
975965
private function isCurrentLineEmpty(): bool
976966
{
@@ -979,8 +969,6 @@ private function isCurrentLineEmpty(): bool
979969

980970
/**
981971
* Returns true if the current line is blank.
982-
*
983-
* @return bool Returns true if the current line is blank, false otherwise
984972
*/
985973
private function isCurrentLineBlank(): bool
986974
{
@@ -989,8 +977,6 @@ private function isCurrentLineBlank(): bool
989977

990978
/**
991979
* Returns true if the current line is a comment line.
992-
*
993-
* @return bool Returns true if the current line is a comment line, false otherwise
994980
*/
995981
private function isCurrentLineComment(): bool
996982
{
@@ -1009,8 +995,6 @@ private function isCurrentLineLastLineInDocument(): bool
1009995
* Cleanups a YAML string to be parsed.
1010996
*
1011997
* @param string $value The input YAML string
1012-
*
1013-
* @return string A cleaned up YAML string
1014998
*/
1015999
private function cleanup(string $value): string
10161000
{
@@ -1045,8 +1029,6 @@ private function cleanup(string $value): string
10451029

10461030
/**
10471031
* Returns true if the next line starts unindented collection.
1048-
*
1049-
* @return bool Returns true if the next line starts unindented collection, false otherwise
10501032
*/
10511033
private function isNextLineUnIndentedCollection(): bool
10521034
{
@@ -1076,8 +1058,6 @@ private function isNextLineUnIndentedCollection(): bool
10761058

10771059
/**
10781060
* Returns true if the string is un-indented collection item.
1079-
*
1080-
* @return bool Returns true if the string is un-indented collection item, false otherwise
10811061
*/
10821062
private function isStringUnIndentedCollectionItem(): bool
10831063
{

Unescaper.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class Unescaper
3333
*
3434
* @param string $value A single quoted string
3535
*
36-
* @return string The unescaped string
36+
* @return string
3737
*/
3838
public function unescapeSingleQuotedString(string $value): string
3939
{
@@ -45,7 +45,7 @@ public function unescapeSingleQuotedString(string $value): string
4545
*
4646
* @param string $value A double quoted string
4747
*
48-
* @return string The unescaped string
48+
* @return string
4949
*/
5050
public function unescapeDoubleQuotedString(string $value): string
5151
{
@@ -62,7 +62,7 @@ public function unescapeDoubleQuotedString(string $value): string
6262
*
6363
* @param string $value An escaped character
6464
*
65-
* @return string The unescaped character
65+
* @return string
6666
*/
6767
private function unescapeCharacter(string $value): string
6868
{

Yaml.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class Yaml
4646
* @param string $filename The path to the YAML file to be parsed
4747
* @param int $flags A bit field of PARSE_* constants to customize the YAML parser behavior
4848
*
49-
* @return mixed The YAML converted to a PHP value
49+
* @return mixed
5050
*
5151
* @throws ParseException If the file could not be read or the YAML is not valid
5252
*/
@@ -69,7 +69,7 @@ public static function parseFile(string $filename, int $flags = 0)
6969
* @param string $input A string containing YAML
7070
* @param int $flags A bit field of PARSE_* constants to customize the YAML parser behavior
7171
*
72-
* @return mixed The YAML converted to a PHP value
72+
* @return mixed
7373
*
7474
* @throws ParseException If the YAML is not valid
7575
*/
@@ -91,7 +91,7 @@ public static function parse(string $input, int $flags = 0)
9191
* @param int $indent The amount of spaces to use for indentation of nested nodes
9292
* @param int $flags A bit field of DUMP_* constants to customize the dumped YAML string
9393
*
94-
* @return string A YAML string representing the original PHP value
94+
* @return string
9595
*/
9696
public static function dump($input, int $inline = 2, int $indent = 4, int $flags = 0): string
9797
{

0 commit comments

Comments
 (0)