| Conditions | 2 |
| Paths | 2 |
| Total Lines | 23 |
| Lines | 23 |
| Ratio | 100 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 45 | View Code Duplication | public function process() |
|
| 46 | { |
||
| 47 | $times = $this->times; |
||
| 48 | // needed due to quirks with __set |
||
| 49 | $time = DBDatetime::now()->Rfc2822(); |
||
| 50 | $times[] = $time; |
||
| 51 | $this->times = $times; |
||
| 52 | |||
| 53 | $this->addMessage('Updated time to ' . $time); |
||
| 54 | sleep(1); |
||
| 55 | |||
| 56 | // make sure we're incrementing |
||
| 57 | $this->currentStep++; |
||
| 58 | |||
| 59 | // if ($this->currentStep > 1) { |
||
| 60 | // $this->currentStep = 1; |
||
| 61 | // } |
||
| 62 | |||
| 63 | // and checking whether we're complete |
||
| 64 | if ($this->currentStep >= $this->totalSteps) { |
||
| 65 | $this->isComplete = true; |
||
| 66 | } |
||
| 67 | } |
||
| 68 | } |
||
| 69 |
Since your code implements the magic setter
_set, this function will be called for any write access on an undefined variable. You can add the@propertyannotation to your class or interface to document the existence of this variable.Since the property has write access only, you can use the @property-write annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.