Issues

ZF-6212: render function throws InvalidArgumentException

Description

I find InvalidArgumentException in render()


    public function render($text, $encoding = 'UTF-8')
    {
        if (!is_string($text)) {
            throw new InvalidArgumentException('$text must be a string');
        }

No need to change into Zend_Text_Figlet_Exception ??

Comments

I find similar issue.

Added class/file InvalidArgumentException and called that instead of the standard PHP InvalidArgumentException.

There are a few other components using the standard PHP exception class. Fix them too?

I don't think so, let's take Matthew a look over it before changing anything.

Throwing SPL exceptions is perfectly valid, and in this case, provides better semantic meaning for the exception itself.

Thank all for comments :D . I understand it.

Throwing SPL's exception, is it against manual? http://framework.zend.com/manual/en/…

Reopen for Mr. Sasezaki. I hear that he could not use reopen command.

Thanks, Satoru.

I had found similar issue. //in ZF-directory


grep -r 'throw new' . | grep -v Zend 

Throwing Zend_Exception-instances in ZF-Classes, wasn't it ZF(ver1)'s policy?

Hello, Sasezaki.

Is this issue still active? Or can I close this ?

Regards

Thanks for comment. As we know currently, ZF2 will implement extends-spl-exception for each components. So, I think this issue can be closed. (But ZF2 is still development!:-) As above Matthew comment, he don't think it is not good that be able not catching every exceptions by Zend_Exception. So that,,, this is not "Coding Standards Violation".

Thank You for quick responce.

Totally I agree, so I will close this once. Thanks.