Re: [PHP-DEV] RFC: Traits for PHP / Reflection
Hi, Markus Fischer schrieb: Hi, generally asking, how would Reflection act on traits? Can this be detected or will the information be lost after a class has been assembled? E.g. detect if a certain method comes from a trait and which one? think will work on the reflection part when details on the semantics has been finished. Kind Regards Stefan -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] RFC: Traits for PHP / Reflection
Hi, generally asking, how would Reflection act on traits? Can this be detected or will the information be lost after a class has been assembled? E.g. detect if a certain method comes from a trait and which one? lG -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] RFC: Traits for PHP / Reflection
Hi Markus, Am Mittwoch, den 20.02.2008, 12:13 +0100 schrieb Markus Fischer: [...] generally asking, how would Reflection act on traits? Can this be detected or will the information be lost after a class has been assembled? E.g. detect if a certain method comes from a trait and which one? Good question. The current patch does not include anything about reflections. But as the information about traits is present in the struct zend_class_entry is is possible to expose trait information via the reflection API. I would propose something like this: class ReflectionTrait: * getMethods(): array[ReflectionMethod] * ... pretty similiar to ReflectionClass extending class ReflectionClass: * getTraits(): array[ReflectionTrait] * usesTraits(): bool extending class ReflectionMethod: * flattened(): bool * getTrait(): ReflectionTrait Maybe ReflectionMethod::flattened() should be ReflectionMethod::belongsToTrait() or something like this, I'm not sure here. cu, Lars signature.asc Description: Dies ist ein digital signierter Nachrichtenteil
Re: [PHP-DEV] RFC: Traits for PHP / Reflection
Markus Fischer wrote: generally asking, how would Reflection act on traits? Can this be detected or will the information be lost after a class has been assembled? E.g. detect if a certain method comes from a trait and which one? Dammit, sorry, I didn't intended to send it to all individuals. - Markus -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php