Conditions | 2 |
Paths | 2 |
Total Lines | 18 |
Code Lines | 9 |
Lines | 17 |
Ratio | 94.44 % |
Changes | 0 |
1 | <?php |
||
35 | View Code Duplication | public function process() |
|
36 | { |
||
37 | $times = $this->times; |
||
38 | // needed due to quirks with __set |
||
39 | $times[] = date('Y-m-d H:i:s'); |
||
40 | $this->times = $times; |
||
41 | |||
42 | $this->addMessage("Updated time to " . date('Y-m-d H:i:s')); |
||
43 | sleep(1); |
||
44 | |||
45 | // make sure we're incrementing |
||
46 | $this->currentStep++; |
||
47 | |||
48 | // and checking whether we're complete |
||
49 | if ($this->currentStep == 5) { |
||
50 | $this->isComplete = true; |
||
51 | } |
||
52 | } |
||
53 | } |
||
54 |
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.