Skip to content

Commit

Permalink
Use native return type declarations in Debug class (#11012)
Browse files Browse the repository at this point in the history
  • Loading branch information
greg0ire authored Oct 15, 2023
1 parent 3c34265 commit e280b2d
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions lib/Doctrine/ORM/Tools/Debug.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ private function __construct()
* @param mixed $var The variable to dump.
* @param int $maxDepth The maximum nesting level for object properties.
*/
public static function dump($var, int $maxDepth = 2): string
public static function dump(mixed $var, int $maxDepth = 2): string
{
$html = ini_get('html_errors');

Expand Down Expand Up @@ -88,12 +88,7 @@ public static function dump($var, int $maxDepth = 2): string
return $dumpText;
}

/**
* @param mixed $var
*
* @return mixed
*/
public static function export($var, int $maxDepth)
public static function export(mixed $var, int $maxDepth): mixed
{
if ($var instanceof Collection) {
$var = $var->toArray();
Expand Down Expand Up @@ -144,12 +139,8 @@ public static function export($var, int $maxDepth)
/**
* Fill the $return variable with class attributes
* Based on obj2array function from {@see https://secure.php.net/manual/en/function.get-object-vars.php#47075}
*
* @param object $var
*
* @return mixed
*/
private static function fillReturnWithClassAttributes($var, stdClass $return, int $maxDepth)
private static function fillReturnWithClassAttributes(object $var, stdClass $return, int $maxDepth): stdClass
{
$clone = (array) $var;

Expand Down

0 comments on commit e280b2d

Please sign in to comment.