php-sage / sage

☯ Insightful PHP Debugging Assistant. Exceeds expectations. PHP 5.1→8.3
MIT License
46 stars 4 forks source link

Not Available Methods #8

Closed gitman2015 closed 8 months ago

gitman2015 commented 8 months ago

Hello, I have just discovered php-sage and I find it good because it avoids the exceptions that Kint generates.

However, I noticed a few things:

1- Sage does not display available methods like in Kint;

2- In the "Called From", we cannot see the complete path like in Kint

3- I haven't seen all of Kint's themes

4- It seems that not all Kint plugins are included Screenshot

gitman2015 commented 8 months ago

The exception in the screenshot above was with Kint. Kint produces an error, Sage does not produce the error when I want to dump the variable $client = Client::createChromeClient(); by Symfony/panther

Furthermore, there is no click system when you click once, twice or three times on the visualization depth of the variable dumped on the + icon

Screenshot-2

raveren commented 8 months ago

Hello, thanks for trying out Sage.

Yes, I did throw out the two useless and costly features:

Also, search was never properly working in Kint for me - along the access path these were the only original features current maintainer of Kint actually implemented, but I didn't port them over.

Themes: there are five in Sage, that means I created one more:

https://github.com/php-sage/sage?tab=readme-ov-file#all-available-options

THEME_ORIGINAL
THEME_LIGHT
THEME_ORIGINAL_LIGHT - the new one, undocumented, sorry :)
THEME_SOLARIZED_DARK
THEME_SOLARIZED

I also made the plain versions more appealing to the eye and consistent with the console output: image

UI: clicking on the [+] opens/closes all child nodes recursively, while clicking anywhere else on the dump header will toggle the current node only. Ah yes, doubleclicking the [+] also closes/opens all nodes in page - children or not, but trippleclicking sounds weird, what does it do in Kint?

My team and I actively use Sage in real day-to-day work and I always fix all annoyances and add new actually useful features as they come up. I'd love to add a performance friendly "copy array/object as code" feature, the access path maybe too - and fix sage call detection in PHP8.3+, but time is short for this now and it's not currently burning. I am also observing symfony var_dumper and ray(), but I think Sage is still useful in that context and I am currently happy with its featureset.

Glad to hear your ideas!

raveren commented 8 months ago

So, I'm sorry, but the object-method-list is not coming back, it's just a completely useless feature. I also stopped the constants from displaying as it was previously.

That data is not dependent on system state and much more simple to access via your editor, don't you agree?

Maybe one day I'll add something like Sage::inspectObject() that will have those, but until the inspiration comes I am closing this issue ✌🏼