Skip to content

Commit 5eab5e9

Browse files
committed
Add a saner var_dump output for the Database object
1 parent c01498e commit 5eab5e9

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/PHPCouchDB/Document.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,15 @@ public function __construct(\GuzzleHttp\ClientInterface $client, string $db_name
4242
}
4343
}
4444
}
45+
46+
/**
47+
* Format object for var_dump() - removes the $client property
48+
*/
49+
public function __debugInfo()
50+
{
51+
// remove the $client object because the output is HUGE
52+
$result = get_object_vars($this);
53+
unset($result['client']);
54+
return $result;
55+
}
4556
}

0 commit comments

Comments
 (0)