I've pushed a couple of commits to clear the backlog here and
something that is definitely a problem with the checker is that it
considers varargs to have a missing initializer. Having the strict
standards checker ignore any thing structured like this:

<methodparam choice="opt">
  <parameter>...</parameter>
</methodparam>

...might cut down the size of the queue somewhat (i.e. ignoring
arguments named as an ellipsis).

I know the majority of array functions that have missingInitializer
errors are suffering from this issue.

Thoughts?

Thanks, Chris

On 10 September 2013 09:10, Chris Wright <c...@daverandom.com> wrote:
> OK great. I'll make a start on correcting the obvious ones and leave
> any I'm not sure about alone, hopefully we can get the outstanding
> list down to just these cases fairly quickly, which will quite
> effectively separate the wheat from the chaff, and we can take another
> look at the situation at that stage :-)
>
> On 10 September 2013 01:41, Hannes Magnusson <hannes.magnus...@gmail.com> 
> wrote:
>> That's a slightly different issue though.
>>
>> In general functions with optional arguments have default value, or can be
>> faked with for example empty array or null. In those cases we should use
>> that for the initializer argument.
>>
>> For others, I think we need to evaluate them on case by case bases what our
>> options are.
>>
>> -Hannes
>>
>> On Sep 9, 2013 5:08 PM, "Chris Wright" <c...@daverandom.com> wrote:
>>>
>>> On 10 September 2013 00:28, Hannes Magnusson <hannes.magnus...@gmail.com>
>>> wrote:
>>> > IMO an optional argument should have a way to "skip it, using default
>>> > value".
>>> > its annoying when in userland you have to do
>>> > if ($option) {
>>> > foo($arg1, $arg2, $option);
>>> > } else {
>>> > foo($arg1, $arg2);
>>> > }
>>> >
>>> > And I consider it a bug when I cannot pass empty string/array/null to
>>> > the optional parameter.
>>>
>>> Agreed. This is closely related to recent discussions on internals,
>>> and without wishing to bring that particular open can of worms over
>>> here I think it would be good to account for the possibility in docs.
>>> My first thought would be to add a phpdoc:skippable="true" (or
>>> something) attribute to parameters, which would possibly have some
>>> form of semantic meaning in the rendered version if any of the
>>> parameter proposals were to make through but, on this topic, would
>>> negate a missingInitializer error. Obviously this would only be valid
>>> for choice="opt" parameters.
>>>
>>> This may be a really bad idea, so please feel free to send any
>>> comments/alternative ideas/abuse in my general direction.
>>>
>>> Cheers, Chris

Reply via email to