Hook PHP objects magic calls #2

Open
opened 2018-01-04 11:40:47 -08:00 by epinna · 4 comments
epinna commented 2018-01-04 11:40:47 -08:00 (Migrated from github.com)

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.

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 commented 2018-01-10 10:52:05 -08:00 (Migrated from github.com)

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

I haven't, but yeah, I could definitely do that.
hperrin commented 2018-01-10 10:52:17 -08:00 (Migrated from github.com)

Didn't mean to close that.

Didn't mean to close that.
epinna commented 2018-01-13 05:09:02 -08:00 (Migrated from github.com)

Cool, looking forward for it.

Cool, looking forward for it.
hperrin commented 2019-12-28 13:26:31 -08:00 (Migrated from github.com)

I've added the ability to hook jsonSerialize.

I've added the ability to hook `jsonSerialize`.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sciactive/hookphp#2
No description provided.