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

From: Date: Fri, 06 Jun 2003 16:10:35 +0000
Subject: #23932 [Asn->Csd]: PEAR_Frontend_CLI::displayError shouldn't dereference $eobj
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-17117@lists.php.net to get a copy of this message
ID: 23932 Updated by: mj@php.net Reported By: greg at chiaraquartet dot net -Status: Assigned +Status: Closed Bug Type: PEAR related Operating System: Windows XP PHP Version: 4.3.2 Assigned To: mj New Comment: Instead of using ui->displayError() in doInfo(), I've changed it to use PEAR::raiseError(). This way it's consistent and we don't need to change the parameter type of displayError(). Apart from that I've added the doc comment in CLI.php, which you've suggested. 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 (#17117) next »