Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
83 | 3 | public function run(string $processName): int |
|
84 | { |
||
85 | 3 | if (null === $this->callback) { |
|
86 | 1 | throw new ThreadException('No callback function defined for the thread'); |
|
87 | } |
||
88 | |||
89 | 2 | $status = ($this->callback)($processName); |
|
90 | |||
91 | 2 | if (null === $status) { |
|
92 | 1 | throw new ThreadException('Error. You must return a process status in your callback function'); |
|
93 | } |
||
94 | |||
95 | 1 | return $status; |
|
96 | } |
||
99 |