In my path to an easy creation of custom adapter classes for WordPress plugins and themes I need a way to collect information about WordPress functions.
The problem
To create custom adapter classes wrapping WordPress globally defined functions in methods I need to collect information about said functions.
While relying on calls to an adapter is a way to go it imposes a slow pace in development forcing a workflow like:
- write a test where the class under test calls a method on the adapter
- run the test
- from the dump (re)generate the custom adapter class
and would like to make things better using an “all in one” workflow:
- install WordPress plugin and collect WordPress defined functions
- (optional) inject call to adapter methods in place of direct calls to WordPress functions in class to test
- scan a class calling an adapter and generate its custom adapter class
Long story made short: I need to collect reflection information about WordPress functions while WordPress is running and a plugin is the path I’ve chosen.
A first working version
I’ve pushed the plugin to GitHub and will be pushing updates there in the next iterations as I try to make it work as intended.