#23932 [Opn->Asn]: PEAR_Frontend_CLI::displayError shouldn't dereference $eobj

From: Date: Fri, 06 Jun 2003 08:28:30 +0000
Subject: #23932 [Opn->Asn]: PEAR_Frontend_CLI::displayError shouldn't dereference $eobj
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-17105@lists.php.net to get a copy of this message
ID: 23932 Updated by: arnaud@php.net Reported By: greg at chiaraquartet dot net -Status: Open +Status: Assigned Bug Type: PEAR related Operating System: Windows XP PHP Version: 4.3.2 -Assigned To: +Assigned To: mj Previous Comments: ------------------------------------------------------------------------ [2003-05-31 18:18:20] greg at chiaraquartet dot net it would be helpful to know for sure whether PEAR_Frontend_CLI::displayError() accepts both strings and objects (a little @param string|object in a docblock would be helpful here). In any case, if you do pear info blah there is a call to a non-object because the source which is: function displayError($eobj) { return $this->_displayLine($eobj->getMessage()); } should be: /** * @param string Error Message */ function displayError($eobj) { return $this->_displayLine($eobj); } or: /** * @param object|string either an error message * or a class with a getMessage() method */ function displayError($eobj) { if (is_object($eobj) { return $this->_displayLine($eobj->getMessage()); } else { return $this->_displayLine($eobj); } } } ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=23932&edit=1

« previous php.pear.dev (#17105) next »