Conditions | 2 |
Paths | 2 |
Total Lines | 19 |
Lines | 19 |
Ratio | 100 % |
Changes | 0 |
1 | <?php |
||
36 | View Code Duplication | public function process() |
|
37 | { |
||
38 | $times = $this->times; |
||
39 | // needed due to quirks with __set |
||
40 | $time = DBDatetime::now()->Rfc2822(); |
||
41 | $times[] = $time; |
||
42 | $this->times = $times; |
||
43 | |||
44 | $this->addMessage('Updated time to ' . $time); |
||
45 | sleep(1); |
||
46 | |||
47 | // make sure we're incrementing |
||
48 | $this->currentStep++; |
||
49 | |||
50 | // and checking whether we're complete |
||
51 | if ($this->currentStep == 5) { |
||
52 | $this->isComplete = true; |
||
53 | } |
||
54 | } |
||
55 | } |
||
56 |
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@property
annotation 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.