Re: svn: /phd/trunk/phpdotnet/phd/ PI/DBHTMLHandler.php PIHandler.php
| From: | Moacir de Oliveira | Date: | Tue, 28 Jul 2009 13:11:28 +0000 |
| Subject: | Re: svn: /phd/trunk/phpdotnet/phd/ PI/DBHTMLHandler.php PIHandler.php | ||
| References: | 1 2 | Groups: | php.doc.cvs |
| Request: | Send a blank email to doc-cvs+get-4540@lists.php.net to get a copy of this message | ||
2009/7/28 Hannes Magnusson <hannes.magnusson@gmail.com>
> 2009/7/28 Moacir de Oliveira Miranda Júnior <moacir@php.net>:
> > + public function setAttribute($attr, $value) {
> > + if (isset($this->attrs[$attr])) {
> > + $this->attrs[$attr] = $value;
> > + }
> > + }
> > +
> > + public function getAttribute($attr) {
> > + return isset($this->attrs[$attr]) ? $this->attrs[$attr] : false;
> > + }
>
> Since you initialize all possible attributes, the isset() calls are
> quite useless, aren't they?
>
The isset() call checks if the attribute you want to get or set is a valid
attribute.
>
>
> > Added: phd/trunk/phpdotnet/phd/PIHandler.php
> > ===================================================================
> > --- phd/trunk/phpdotnet/phd/PIHandler.php
> (rev 0)
> > +++ phd/trunk/phpdotnet/phd/PIHandler.php 2009-07-28 05:35:48 UTC
> (rev 286436)
> > @@ -0,0 +1,15 @@
> > +<?php
> > +namespace phpdotnet\phd;
> > +
> > +abstract class PIHandler {
> > + protected $format;
>
>
> You are missing a getter for this variable.
>
The $format attr is just for internal use, I don't think we need a getter
here.