Zend Framework

Wrong return type for Zend_Dom_Query_Css2XPath::transform()

Details

  • Type: Docs:  Problem Docs: Problem
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 1.9.0
  • Component/s: Zend_Dom_Query
  • Labels:
    None
  • Language:
    English

Description

The docblock for Zend_Dom_Query_Css2XPath::transform() indicates that the only return type should be a string. However, when multiple expressions are specified, it is possible for it to return an array. It appears from its test suite that this is expected behavior. See the test suite method testTransformShouldReturnMultiplePathsWhenExpressionContainsCommas(). The docblock should be corrected to reflect this.

Issue Links

Activity

Hide
Matthew Turland added a comment -

Patch to correct the docblock issue.

Show
Matthew Turland added a comment - Patch to correct the docblock issue.
Hide
Matthew Turland added a comment -

Zend_Dom_Query::query() passes the return value of Zend_Dom_Query_Css2XPath::transform() as the first parameter ($xpathQuery) to
Zend_Dom_Query::queryXPath(). The docblock for Zend_Dom_Query::queryXPath() indicates that $xpathQuery may only be a string, but can obviously also be an array.

Show
Matthew Turland added a comment - Zend_Dom_Query::query() passes the return value of Zend_Dom_Query_Css2XPath::transform() as the first parameter ($xpathQuery) to Zend_Dom_Query::queryXPath(). The docblock for Zend_Dom_Query::queryXPath() indicates that $xpathQuery may only be a string, but can obviously also be an array.
Hide
Matthew Turland added a comment -

Updated patch to include fix for Zend_Dom_Query::queryXPath().

Show
Matthew Turland added a comment - Updated patch to include fix for Zend_Dom_Query::queryXPath().
Hide
Satoru Yoshida added a comment -

Solve in SVN r17292

Show
Satoru Yoshida added a comment - Solve in SVN r17292

People

Vote (1)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: