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

dump function arguments with PrettyPageHandler #642

Closed
Druid33 opened this issue Oct 22, 2019 · 4 comments
Closed

dump function arguments with PrettyPageHandler #642

Druid33 opened this issue Oct 22, 2019 · 4 comments

Comments

@Druid33
Copy link
Contributor

Druid33 commented Oct 22, 2019

Hi, i use PrettyPageHandler to display errors in my application. I think, its awesome library.

In stacktrace, bellow code i expected function arguments to be displayed. Its ok for primitive types. But for objects Whoops display only type of object instead of expandable dump of variable.

What i see:
image

What i expected:
image

I dig into tho code and find, that if i comment adding Casters to Cloner in PrettyPageHnadler->__construct() method, i get output i expected.

$cloner->addCasters(['*' => function ($obj, $a, $stub, $isNested, $filter = 0) {

Its a future or its a bug? :)

@denis-sokolov
Copy link
Collaborator

It does, indeed, look like a bug. Thank you for reporting this!

Somebody will take a look at it and hopefully we’ll get it fixed properly.

@denis-sokolov
Copy link
Collaborator

I’ve now found out this is on purpose, as dumping everything indiscriminately did not allow us to maintain the level of performance we expect. See #401 and #404!

Thanks for bringing it up, if anyone comes up with an improvement, let us know.

@Druid33
Copy link
Contributor Author

Druid33 commented Apr 29, 2020

Hi, again.

First sorry for reopening ticket.

I use PrettyPageHandler with commented line i mention in ticket description for 5 months without performance issues. I know...its only my case.

The problem is, that i cant extend PrettyPageHandler and use my own cloner instance, because cloner is set in constructor. So i copy-paste that class and make lot of dirty changes to make it run.

Now, i start new project, i like to have function arguments dumped, but i dont wont make dirty copy-paste "solution" again.

It will be fine have chance make it clean. Is it possible to make simple protected setCloner() method on PrettyPageHandler?

protected setCloner($cloner) 
{
    $this->templateHelper->setCloner($cloner);
}

I thing thats enough for everyone, who can dump funcion argument in PrettyPageHandler.

@Druid33
Copy link
Contributor Author

Druid33 commented Apr 30, 2020

..or just make $templateHelper property protected instead of private.

/**
* @var TemplateHelper
*/
protected $templateHelper;

@Druid33 Druid33 mentioned this issue May 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants