WordPress functions dumper 01

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:

  1. write a test where the class under test calls a method on the adapter
  2. run the test
  3. from the dump (re)generate the custom adapter class

and would like to make things better using an “all in one” workflow:

  1. install WordPress plugin and collect WordPress defined functions
  2. (optional) inject call to adapter methods in place of direct calls to WordPress functions in class to test
  3. 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.