Ibmurai/frood — Issue #6: Working with and documenting default values in controllers
Author: localgod
Created: 2012-01-06 09:34:54+00:00
State: open

When assigning default values in the current implementation of frood it is done like this:
'''
/*
* Some action
*
* @param interger $id <1> The id
*
* @return void
*/
function indexAction($id) {
//Do stuff
}
'''
A more php'ish way would be more like:

/*
* Some action
*
* @param interger $id The id
*
* @return void
*/
function indexAction($id = 1) {
//Do stuff
}

This might be accomplished by modifying Frood to use http://us2.php.net/debug_backtrace to "discover" the the values and type check them in a pseudo call before the requested action is actually called.

The main thing we gain with this is a docblock without special Frood syntax.

There might be other benefits/drawbacks, but I'll guess we just have to try it out first.