[VarDumper] fix annotations

This commit is contained in:
Nicolas Grekas 2019-08-15 10:03:47 +02:00
parent 6a1382637b
commit 82f4766498
3 changed files with 17 additions and 17 deletions

View File

@ -61,7 +61,7 @@ class Data implements \ArrayAccess, \Countable, \IteratorAggregate
}
/**
* @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 @@ class Data implements \ArrayAccess, \Countable, \IteratorAggregate
*
* @param int $maxDepth The max dumped depth level
*
* @return self A clone of $this
* @return static
*/
public function withMaxDepth($maxDepth)
{
@ -197,7 +197,7 @@ class Data implements \ArrayAccess, \Countable, \IteratorAggregate
*
* @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 @@ class Data implements \ArrayAccess, \Countable, \IteratorAggregate
*
* @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 @@ class Data implements \ArrayAccess, \Countable, \IteratorAggregate
*
* @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)
{

View File

@ -40,21 +40,21 @@ interface DumperInterface
/**
* 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);
}

View File

@ -185,13 +185,13 @@ abstract class AbstractDumper implements DataDumperInterface, DumperInterface
/**
* 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;
}