You appear to be a bot. Output may be restricted
Description
Print a parameterParameter #1 [ <optional> $parm2 = NULL ]DocBlock Object ( [short_description:protected] => relect on me a while [long_description:protected] => Function to test the reflection logic to parse phpDoc comments and function prototypes If this works we can use this to dynamically generate content on the webpage BUT, since it may be dependent upon a certain version of PHP we might just have to create or update an oik_api record with the information [tags:protected] => Array ( [0] => @link http://www.oik-plugins/ [1] => @param string $parm1 - parameter 1 [2] => @return string|null ) [namespace:protected] => \ [namespace_aliases:protected] => Array ( ) )When the param is an array then we may document the array with a series of @type tags which should also be formatted for the given param We stop processing the @type fields when we come across another @param tag
Usage
oikai_print_param( $param, $docblock );
Parameters
- $param
- ( object ) required – refFunc parameter object
- $docblock
- ( object ) required – docBlock for the function
Returns
voidSource
File name: oik-shortcodes/shortcodes/oik-api-importer.phpLines:
1 to 45 of 45
function oikai_print_param( $param, $docblock ) { //bw_trace2(); //bw_backtrace(); $parm = bw_array_get( $param, "name" ); $parm = "$". $parm; $tags = $docblock->getTags(); $found = null; //bw_trace2( $parm, "parm", true, BW_TRACE_VERBOSE ); //bw_trace2( $tags, "tags", false, BW_TRACE_VERBOSE ); $processed = null; $starteddl = false; foreach ( $tags as $tag ) { bw_trace2( $tag, "tag", false, BW_TRACE_VERBOSE ); list( $tagname, $type, $name, $description ) = oikai_explode_tag( $tag ); if ( $tagname == "@param" ) { if ( $name == $parm ) { oikai_print_param_info( $param, $type, $name, $description ); $found = $name; $processed = $name; //break; } else { $found = null; //bw_trace2( $name, "wrong param $parm " ); } } elseif ( $tagname == "@type" ) { if ( $found == $parm ) { if ( !$starteddl ) { stag( "dl" ); $starteddl = true; } oikai_print_param_info( $param, $type, $name, $description ); } } else { // I think we can do without the break! break; } } if ( $starteddl ) { etag( "dl" ); } if ( null == $processed ) { oikai_print_param_info( $param ); } }View on GitHub