From 82f4766498861cad1b63da6eac9bb5a131066e70 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Thu, 15 Aug 2019 10:03:47 +0200 Subject: [PATCH] [VarDumper] fix annotations --- .../Component/VarDumper/Cloner/Data.php | 10 +++++----- .../VarDumper/Cloner/DumperInterface.php | 18 +++++++++--------- .../VarDumper/Dumper/AbstractDumper.php | 6 +++--- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/Symfony/Component/VarDumper/Cloner/Data.php b/src/Symfony/Component/VarDumper/Cloner/Data.php index f64ebf318423..0909c04cd2c6 100644 --- a/src/Symfony/Component/VarDumper/Cloner/Data.php +++ b/src/Symfony/Component/VarDumper/Cloner/Data.php @@ -61,7 +61,7 @@ public function getType() } /** - * @param bool $recursive Whether values should be resolved recursively or not + * @param array|bool $recursive Whether values should be resolved recursively or not * * @return string|int|float|bool|array|Data[]|null A native representation of the original value */ @@ -182,7 +182,7 @@ public function getRawData() * * @param int $maxDepth The max dumped depth level * - * @return self A clone of $this + * @return static */ public function withMaxDepth($maxDepth) { @@ -197,7 +197,7 @@ public function withMaxDepth($maxDepth) * * @param int $maxItemsPerDepth The max number of items dumped per depth level * - * @return self A clone of $this + * @return static */ public function withMaxItemsPerDepth($maxItemsPerDepth) { @@ -212,7 +212,7 @@ public function withMaxItemsPerDepth($maxItemsPerDepth) * * @param bool $useRefHandles False to hide global ref. handles * - * @return self A clone of $this + * @return static */ public function withRefHandles($useRefHandles) { @@ -227,7 +227,7 @@ public function withRefHandles($useRefHandles) * * @param string|int $key The key to seek to * - * @return self|null A clone of $this or null if the key is not set + * @return static|null Null if the key is not set */ public function seek($key) { diff --git a/src/Symfony/Component/VarDumper/Cloner/DumperInterface.php b/src/Symfony/Component/VarDumper/Cloner/DumperInterface.php index cb498ff70657..912bb5213975 100644 --- a/src/Symfony/Component/VarDumper/Cloner/DumperInterface.php +++ b/src/Symfony/Component/VarDumper/Cloner/DumperInterface.php @@ -40,21 +40,21 @@ public function dumpString(Cursor $cursor, $str, $bin, $cut); /** * Dumps while entering an hash. * - * @param Cursor $cursor The Cursor position in the dump - * @param int $type A Cursor::HASH_* const for the type of hash - * @param string $class The object class, resource type or array count - * @param bool $hasChild When the dump of the hash has child item + * @param Cursor $cursor The Cursor position in the dump + * @param int $type A Cursor::HASH_* const for the type of hash + * @param string|int $class The object class, resource type or array count + * @param bool $hasChild When the dump of the hash has child item */ public function enterHash(Cursor $cursor, $type, $class, $hasChild); /** * Dumps while leaving an hash. * - * @param Cursor $cursor The Cursor position in the dump - * @param int $type A Cursor::HASH_* const for the type of hash - * @param string $class The object class, resource type or array count - * @param bool $hasChild When the dump of the hash has child item - * @param int $cut The number of items the hash has been cut by + * @param Cursor $cursor The Cursor position in the dump + * @param int $type A Cursor::HASH_* const for the type of hash + * @param string|int $class The object class, resource type or array count + * @param bool $hasChild When the dump of the hash has child item + * @param int $cut The number of items the hash has been cut by */ public function leaveHash(Cursor $cursor, $type, $class, $hasChild, $cut); } diff --git a/src/Symfony/Component/VarDumper/Dumper/AbstractDumper.php b/src/Symfony/Component/VarDumper/Dumper/AbstractDumper.php index 30cd1a1b193d..1713e3035525 100644 --- a/src/Symfony/Component/VarDumper/Dumper/AbstractDumper.php +++ b/src/Symfony/Component/VarDumper/Dumper/AbstractDumper.php @@ -185,13 +185,13 @@ protected function echoLine($line, $depth, $indentPad) /** * Converts a non-UTF-8 string to UTF-8. * - * @param string $s The non-UTF-8 string to convert + * @param string|null $s The non-UTF-8 string to convert * - * @return string The string converted to UTF-8 + * @return string|null The string converted to UTF-8 */ protected function utf8Encode($s) { - if (preg_match('//u', $s)) { + if (null === $s || preg_match('//u', $s)) { return $s; }