Issue Details (XML | Word | Printable)

Key: ZF-7909
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Benjamin Eberlei
Reporter: Chris Buckley
Votes: 1
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Google issue summary
Zend Framework

Zend_CodeGenerator_Php_Class::fromReflection doesn't handle interfaces correctly

Created: 21/Sep/09 07:26 AM   Updated: 24/Sep/09 01:50 PM   Resolved: 24/Sep/09 01:50 PM
Component/s: Zend_CodeGenerator
Affects Version/s: 1.9.2
Fix Version/s: 1.9.4

Time Tracking:
Not Specified

File Attachments: 1. Text File Zend_CodeGenerator_Php_Class.patch (0.8 kB)



 Description  « Hide

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



Satoru Yoshida added a comment - 23/Sep/09 06:40 PM

Set component and auto reassign


Benjamin Eberlei added a comment - 24/Sep/09 01:19 PM

on it!


Benjamin Eberlei added a comment - 24/Sep/09 01:50 PM

Fixed and merged into 1.9 release branch.