Zend Framework

Zend_CodeGenerator_Php_Class::fromReflection doesn't handle interfaces correctly

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.9.2
  • Fix Version/s: 1.9.4
  • Component/s: Zend_CodeGenerator
  • Labels:
    None

Description

The fromReflection method tries to set the implemented interfaces on the new instance directly from the reflection's getInterfaces() method. However the setImplementedInterfaces() method expects an array of strings, and Zend_Reflection_Class::getInterfaces() returns an array of Zend_Reflection_Class.

Also, the array_diff for discarding interfaces implemented by the parent class is the wrong way round. It should be array_diff($reflectionClass..., $parentClass...)

Suggest the changes supplied in the attached patch

Activity

Hide
Satoru Yoshida added a comment -

Set component and auto reassign

Show
Satoru Yoshida added a comment - Set component and auto reassign
Hide
Benjamin Eberlei added a comment -

on it!

Show
Benjamin Eberlei added a comment - on it!
Hide
Benjamin Eberlei added a comment -

Fixed and merged into 1.9 release branch.

Show
Benjamin Eberlei added a comment - Fixed and merged into 1.9 release branch.

People

Vote (1)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: