Re: [PEPr] +1 for Networking::Net_MAC

From: Date: Wed, 13 Dec 2006 20:40:49 +0000
Subject: Re: [PEPr] +1 for Networking::Net_MAC
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-45201@lists.php.net to get a copy of this message
I have updated the code as suggested. Please take a look again as I believe I have fixed all the errors you pointed out. I hadn't used exceptions before today, so I was a little unclear on how they functioned. Thanks for the help. On 13 Dec 2006 19:51:54 -0000, Greg Beaver <greg@chiaraquartet.net> wrote:
Greg Beaver (http://pear.php.net/user/cellog) has voted +1 on the proposal for Networking::Net_MAC. Proposal information: http://pear.php.net/pepr/pepr-proposal-show.php?id=454 Vote information: http://pear.php.net/pepr/pepr-vote-show.php?id=454&handle=cellog This vote is conditional. The condition is: This code:
        try {
            if (!isset($options['vendorcol'])) {
                throw new PEAR_Exception('No vendor column name given in options');
            }
        } catch (PEAR_Exception $e) {
            throw $e;
        }
is redundant and unnecessary. Just do:
        if (!isset($options['vendorcol'])) {
            throw new PEAR_Exception('No vendor column name given in options');
        }
In addition, you should not be using the raw PEAR_Exception. It should have either a code, or be customized. You can do this with a 1-liner class Net_MAC_Exception extends PEAR_Exception {} The last issue is critical - you should not be using PEAR_Exception raw. The first one is cosmetic but will also affect performance so you should do it :). -- Sent by PEPr, the automatic proposal system at http://pear.php.net


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