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

Hook PHP objects magic calls #2

Open
epinna opened this issue Jan 4, 2018 · 4 comments
Open

Hook PHP objects magic calls #2

epinna opened this issue Jan 4, 2018 · 4 comments
Assignees

Comments

@epinna
Copy link

epinna commented Jan 4, 2018

Hello,

Have you thought to allow to hook magic calls too? For example

\SciActive\Hook::addCallback('Test->__toString', -2, function(&$arguments, $name, &$object, &$function, &$data){
});

Would be triggered by print($obj);. Same for constructor, setters and getters, etc.

@hperrin
Copy link
Member

hperrin commented Jan 10, 2018

I haven't, but yeah, I could definitely do that.

@hperrin hperrin closed this as completed Jan 10, 2018
@hperrin hperrin reopened this Jan 10, 2018
@hperrin
Copy link
Member

hperrin commented Jan 10, 2018

Didn't mean to close that.

@hperrin hperrin self-assigned this Jan 10, 2018
@epinna
Copy link
Author

epinna commented Jan 13, 2018

Cool, looking forward for it.

@hperrin
Copy link
Member

hperrin commented Dec 28, 2019

I've added the ability to hook jsonSerialize.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants