Re: Type Hint Not Found

From: Date: Wed, 01 Apr 2015 14:07:27 +0000
Subject: Re: Type Hint Not Found
References: 1  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969385545@lists.php.net to get a copy of this message
On 1 April 2015 at 14:04, Hollenbeck, Scott <shollenbeck@verisign.com> wrote: > I'm using docgen.php to produce XML documentation skeletons for an > extension I'm writing. It's producing this warning: > > "-- Type hint for parameter `transID' not found, 'string' used" > > The source for my extension includes these macros: > > ZEND_BEGIN_ARG_INFO(address_args, 0) > ZEND_ARG_TYPE_INFO(0, context, IS_LONG, 0) > ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) > ZEND_ARG_TYPE_INFO(0, extensions, IS_LONG, 1) > ZEND_ARG_TYPE_INFO(0, userArg, IS_RESOURCE, 1) > ZEND_ARG_TYPE_INFO(1, transID, IS_LONG, 0) > ZEND_ARG_TYPE_INFO(0, callback, IS_STRING, 0) > ZEND_END_ARG_INFO() > > Note the fifth ZEND_ARG_TYPE_INFO line where the IS_LONG type hint is > provided. The warning goes away if I change the first argument on that line > from 1 to 0, but I need that particular argument passed by reference. > > Am I doing something wrong here? Why isn't the IS_LONG type hint being > recognized? > TL;DR - you're not doing anything wrong, docgen.php doesn't support that yet. The docgen script looks at the ReflectionParameter::__toString() text to determine parameter types (because the script is ancient). At the moment, we don't include scalar type declarations in those parameter descriptions. For illustration, here are the values for the first parameters to DOMXPath::__construct() and mt_rand(), respectively Parameter #0 [ <required> DOMDocument $doc ] Parameter #0 [ <optional> $min ] The constructor $doc parameter has a type hint, but the $min parameter does not. > > Thank you, > Scott >

« previous php.doc (#969385545) next »