Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use native return type declarations in Debug class #11012

Merged
merged 1 commit into from
Oct 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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