1 | <?php |
||
7 | class WrapperRunner extends BaseRunner |
||
8 | { |
||
9 | const PHPUNIT_FAILURES = 1; |
||
10 | const PHPUNIT_ERRORS = 2; |
||
11 | |||
12 | /** |
||
13 | * @var array |
||
14 | */ |
||
15 | protected $streams; |
||
16 | |||
17 | /** |
||
18 | * @var Worker[] |
||
19 | */ |
||
20 | protected $workers; |
||
21 | |||
22 | /** |
||
23 | * @var array |
||
24 | */ |
||
25 | protected $modified; |
||
26 | |||
27 | public function run() |
||
37 | |||
38 | protected function load() |
||
45 | |||
46 | private function startWorkers() |
||
47 | { |
||
48 | $wrapper = realpath(__DIR__ . '/../../../bin/phpunit-wrapper'); |
||
49 | for ($i = 1; $i <= $this->options->processes; ++$i) { |
||
50 | $worker = new Worker(); |
||
51 | if ($this->options->noTestTokens) { |
||
52 | $token = null; |
||
53 | $uniqueToken = null; |
||
54 | } else { |
||
55 | $token = $i; |
||
56 | $uniqueToken = uniqid(); |
||
57 | } |
||
58 | $worker->start($wrapper, $token, $uniqueToken); |
||
59 | $this->streams[] = $worker->stdout(); |
||
60 | $this->workers[] = $worker; |
||
61 | } |
||
62 | } |
||
63 | |||
64 | private function assignAllPendingTests() |
||
82 | |||
83 | private function sendStopMessages() |
||
89 | |||
90 | private function waitForAllToFinish() |
||
104 | |||
105 | // put on WorkersPool |
||
106 | private function waitForStreamsToChange(array $modified) |
||
118 | |||
119 | /** |
||
120 | * put on WorkersPool. |
||
121 | * |
||
122 | * @return Worker[] |
||
123 | */ |
||
124 | private function progressedWorkers(): array |
||
141 | |||
142 | /** |
||
143 | * Returns the output streams of a subset of workers. |
||
144 | * |
||
145 | * @param array keys are positions in $this->workers |
||
146 | * |
||
147 | * @return array |
||
148 | */ |
||
149 | private function streamsOf(array $workers): array |
||
158 | |||
159 | private function complete() |
||
171 | |||
172 | private function setExitCode() |
||
182 | |||
183 | private function flushWorker(Worker $worker) |
||
191 | |||
192 | /* |
||
193 | private function testIsStillRunning($test) |
||
194 | { |
||
195 | if(!$test->isDoneRunning()) return true; |
||
196 | $this->setExitCode($test); |
||
197 | $test->stop(); |
||
198 | if (static::PHPUNIT_FATAL_ERROR === $test->getExitCode()) |
||
199 | throw new \Exception($test->getStderr(), $test->getExitCode()); |
||
200 | return false; |
||
201 | } |
||
202 | */ |
||
203 | } |
||
204 |
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.