ZF-7909: Zend_CodeGenerator_Php_Class::fromReflection doesn't handle interfaces correctly

Issue Type: Bug Created: 2009-09-21T07:26:18.000+0000 Last Updated: 2009-09-24T13:50:26.000+0000 Status: Resolved Fix version(s): - 1.9.4 (13/Oct/09)

Reporter: Chris Buckley (cbuckley) Assignee: Benjamin Eberlei (beberlei) Tags: - Zend_CodeGenerator

Related issues: Attachments: - Zend_CodeGenerator_Php_Class.patch


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


Posted by Satoru Yoshida (satoruyoshida) on 2009-09-23T18:40:11.000+0000

Set component and auto reassign

Posted by Benjamin Eberlei (beberlei) on 2009-09-24T13:19:41.000+0000

on it!

Posted by Benjamin Eberlei (beberlei) on 2009-09-24T13:50:26.000+0000

Fixed and merged into 1.9 release branch.

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.