Re: Coding Standard Question

From: Date: Fri, 14 Nov 2008 10:12:46 +0000
Subject: Re: Coding Standard Question
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-51080@lists.php.net to get a copy of this message
> I have just finished a package that will be proposed to PEAR, but since this > is my first experience with the PEAR coding standard, I have a question. > When running phpcs against my code, I get 2 errors for the following code > snippet: > > function setShippingAddress(array $shippingAddress = array()) > { > $this->_setAddress( > $shippingInfo, > Payment_PagamentoCerto_Order::ADDRESS_TYPE_SHIPPING > ); > } > > The errors are: > > ERROR | Space after opening parenthesis of function call prohibited > ERROR | Space before closing parenthesis of function call prohibited > > If I put both parameters in the same line, it will exceed 85 characters. > If I try to avoid both errors, I end up with ugly code: > > $this->_setAddress($shippingInfo, > Payment_PagamentoCerto_Order::ADDRESS_TYPE_SHIPPING); > This is something that stands for the current CS and I do agree that it looks ugly. However there's a good news, Christian Weiske has started a proposal in order to enhance the current coding standards[1] and this very exact issue is covered. -- Slan, David

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