Re: Reflection to remove final
| From: | Laruence | Date: | Tue, 17 Jan 2012 12:54:51 +0000 |
| Subject: | Re: Reflection to remove final | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-57392@lists.php.net to get a copy of this message | ||
On Tue, Jan 17, 2012 at 6:22 PM, Sebastian Bergmann <sebastian@php.net> wrote:
> Am 16.01.2012 19:06, schrieb Jan Dolecek:
>> reflection is a great tool for testing, but it still misses support
>> for mocking classes/methods marked as final. I created a small patch
>> https://gist.github.com/1621839#file_php_finals.patch,
>> examples how to
>> use it https://gist.github.com/1621839#file_final_test.php
>> and wrote a
>> short article explaining it:
>>
>> http://blog.juzna.cz/2012/01/mock-vs-final-fights-in-testing/.
>
> +1 from me for the idea. Implementation looks good at first glance as
> well, but I let more knowledgable C developers be the judge of that..
if a class is marked as final, there must be some reason for it to be a final.
if you remove the final and extends it, may lead to bad error.
thanks
>
> --
> Sebastian Bergmann Co-Founder and Principal Consultant
> http://sebastian-bergmann.de/
> http://thePHP.cc/
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--
Laruence Xinchen Hui
http://www.laruence.com/