Re: Mail/mime.php changes
| From: | Jon Parise | Date: | Sun, 16 Sep 2001 18:49:43 +0000 |
| Subject: | Re: Mail/mime.php changes | ||
| References: | 1 2 3 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-1957@lists.php.net to get a copy of this message | ||
On Sun, Sep 16, 2001 at 08:19:24PM +0200, Tomas V.V.Cox wrote:
> > > if (!isset($this->_txtbody))
> > > $this->_txtbody = 'No text version was supplied';
> > >
> >
> > Please wrap single statements like this in braces.
> >
> > You might want to change that !isset() test to an empty() test,
> > too.
>
> That could sound strange, but if my email only have the char "0" in the
> body? Don't forget that there are automated systems that could transfer
> data by e-mail. That's applied also for e-mail with only attachments.
That's a good point. I suppose the !isset() would be sufficient
in all cases. Even an empty text body (that is set) should be
valid.
> > Also, the majority of the PEAR code uses 'true' and 'false'
> > (lowercase). I'm not sure if we should make that a style
> > standard, but it might be good to keep that consistent. There's
> > no functional difference, of course.
>
> +1 to standarize special vars casing (CONSTANTS, true, false, null,
> "ERROR_CODES", ...).
I guess enough people are behind this now. Want to add it to
CODING_STANDARDS?
--
Jon Parise (jon@csh.rit.edu) . Information Technology (B.S.)
http://www.csh.rit.edu/~jon/ : Computer Science House
Member