Conditions | 3 |
Paths | 4 |
Total Lines | 13 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
16 | public function run($callback = null) { |
||
17 | $this->start($callback); |
||
18 | while($this->isRunning()) { |
||
19 | $this->checkTimeout(); |
||
20 | sleep(1); |
||
21 | } |
||
22 | |||
23 | if ($this->hasBeenSignaled()) { |
||
24 | throw new RuntimeException(sprintf('The process has been signaled with signal "%s".', $this->getTermSignal)); |
||
|
|||
25 | } |
||
26 | |||
27 | return $this->getExitCode(); |
||
28 | } |
||
29 | } |
||
30 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: