Zend Framework

Zend_Server_Reflection should allow specifying docblock parameters for parameters not in the method signature

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.0.1
  • Fix Version/s: 1.6.0
  • Component/s: Zend_Server_Reflection
  • Labels:
    None
  • Fix Version Priority:
    Should Have

Description

The class Zend_View_Helper_DeclareVars has a method declareVars() that reads its parameters with func_get_args(). The docblock declares a @param for variable arguments, but the function signature declares no parameters.

This is apparently legitimate coding practice according to example in http://php.net/func-get-args, but it break Zend_Server_Reflection. Zend_Server_Reflection_Function::_refect() makes an assumption that if a parameter is documented with a @param tag in the docblock, then there must be a corresponding parameter declared in the method signature.

Issue Links

Activity

Hide
Bill Karwin added a comment -

Linking to related issue that affects Zend_Db_Table.

Show
Bill Karwin added a comment - Linking to related issue that affects Zend_Db_Table.
Hide
Matthew Weier O'Phinney added a comment -

I'm re-marking this as a Zend_Server_Reflection bug, and re-titling the summary, as it's not really an issue with DeclareVars so much as with Zend_Server_Reflection not treating docblock params that are unmatched in the method signature as optional parameters.

Show
Matthew Weier O'Phinney added a comment - I'm re-marking this as a Zend_Server_Reflection bug, and re-titling the summary, as it's not really an issue with DeclareVars so much as with Zend_Server_Reflection not treating docblock params that are unmatched in the method signature as optional parameters.
Hide
Wil Sinclair added a comment -

This doesn't appear to have been fixed in 1.5.0. Please update if this is not correct.

Show
Wil Sinclair added a comment - This doesn't appear to have been fixed in 1.5.0. Please update if this is not correct.
Hide
Matthew Weier O'Phinney added a comment -

Scheduling for next minor release.

Show
Matthew Weier O'Phinney added a comment - Scheduling for next minor release.
Hide
Alexander Veremyev added a comment -

Fixed.

Exception is thrown now if number of arguments doesn't correspond number of actual function arguments.

That should be the best solution for services.

Show
Alexander Veremyev added a comment - Fixed. Exception is thrown now if number of arguments doesn't correspond number of actual function arguments. That should be the best solution for services.
Hide
Wil Sinclair added a comment -

Updating for the 1.6.0 release.

Show
Wil Sinclair added a comment - Updating for the 1.6.0 release.

People

Vote (1)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved:

Time Tracking

Estimated:
4h
Original Estimate - 4 hours
Remaining:
4h
Remaining Estimate - 4 hours
Logged:
Not Specified
Time Spent - Not Specified