Zend Framework

Zend_Reflection_File does not reflect interfaces. Zend_CodeGenerator cannot generate interfaces.

Details

Description

The tokenizer in Zend_Reflection_File ignores T_INTERFACE so it is not possible to reflect interfaces within files at the moment. Zend_Reflection_Class inherits ReflectionClass thus it should be possible to reflect interfaces.

Zend_CodeGenerator_Php_Class assumes that Zend_Reflection_Class is always a class. So it is not possible to generate an interface.

Activity

Hide
Ralph Schindler added a comment -

Fixed in r17426 in trunk

Show
Ralph Schindler added a comment - Fixed in r17426 in trunk
Hide
Rüdiger Krieg added a comment -

Your fix for Zend_Reflection_File is fine.

The other part of the issue concerning Zend_CodeGenerator_Class seems to be still existing. Shall I open another issue for that?

The problem is that Zend_CodeGenerator assumes that Zend_Reflection_Class is always a class not an interface. If you try to generate an interface with Zend_CodeGenerator_File parsed via Zend_Reflection_File you will encounter some problems.

Zend_CodeGenerator_File::fromReflection() does not set the filename. I think

$file->setFilename($reflectionFile->getFileName());

following the line with

$file = new self();
will fix that.

Show
Rüdiger Krieg added a comment - Your fix for Zend_Reflection_File is fine. The other part of the issue concerning Zend_CodeGenerator_Class seems to be still existing. Shall I open another issue for that? The problem is that Zend_CodeGenerator assumes that Zend_Reflection_Class is always a class not an interface. If you try to generate an interface with Zend_CodeGenerator_File parsed via Zend_Reflection_File you will encounter some problems. Zend_CodeGenerator_File::fromReflection() does not set the filename. I think
$file->setFilename($reflectionFile->getFileName());
following the line with
$file = new self();
will fix that.

People

Vote (1)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: