These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | use Robo\Result; |
||
3 | |||
4 | use Consolidation\AnnotatedCommand\CommandData; |
||
5 | use Consolidation\OutputFormatters\Options\FormatterOptions; |
||
6 | use Consolidation\OutputFormatters\StructuredData\RowsOfFields; |
||
7 | use Consolidation\OutputFormatters\StructuredData\PropertyList; |
||
8 | use Symfony\Component\Console\Input\InputOption; |
||
9 | |||
10 | /** |
||
11 | * Example RoboFile. |
||
12 | * |
||
13 | * To test: |
||
14 | * |
||
15 | * $ cd ROBO_PROJECT/examples |
||
16 | * $ ../robo try:success |
||
17 | * |
||
18 | * - or - |
||
19 | * |
||
20 | * $ cd ROBO_PROJECT |
||
21 | * $ ./robo -f examples try:formatters |
||
22 | */ |
||
23 | class RoboFile extends \Robo\Tasks |
||
0 ignored issues
–
show
|
|||
24 | { |
||
25 | /** |
||
26 | * Watch a file. |
||
27 | * |
||
28 | * Demonstrates the 'watch' command. Runs 'composer update' any time |
||
29 | * composer.json changes. |
||
30 | */ |
||
31 | public function tryWatch() |
||
32 | { |
||
33 | $this->taskWatch()->monitor(['composer.json', 'composer.lock'], function () { |
||
34 | $this->taskComposerUpdate()->run(); |
||
35 | })->run(); |
||
36 | } |
||
37 | |||
38 | /** |
||
39 | * Demonstrates Robo input APIs. |
||
40 | */ |
||
41 | public function tryInput() |
||
42 | { |
||
43 | $this->say('The <b>expression</b> <bogus>is</bogus> <info>a < b</> it even works'); |
||
44 | $answer = $this->ask('how are you?'); |
||
45 | $this->say('You are '.$answer); |
||
46 | $yes = $this->confirm('Do you want one more question?'); |
||
47 | if (!$yes) { |
||
48 | return Result::cancelled(); |
||
49 | } |
||
50 | $lang = $this->askDefault('what is your favorite scripting language?', 'PHP'); |
||
51 | $this->say($lang); |
||
52 | $pin = $this->askHidden('Ok, now tell your PIN code (it is hidden)'); |
||
53 | $this->yell('Ha-ha, your pin code is: '.$pin); |
||
54 | $this->say('Bye!'); |
||
55 | } |
||
56 | |||
57 | /** |
||
58 | * Demonstrates parallel execution. |
||
59 | * |
||
60 | * @option $printed Print the output of each process. |
||
61 | * @option $error Include an extra process that fails. |
||
62 | */ |
||
63 | public function tryPara($options = ['printed' => false, 'error' => false]) |
||
64 | { |
||
65 | $dir = dirname(__DIR__); |
||
66 | $para = $this->taskParallelExec() |
||
67 | ->printed($options['printed']) |
||
68 | ->process("php $dir/tests/_data/parascript.php hey 4") |
||
69 | ->process("php $dir/tests/_data/parascript.php hoy 3") |
||
70 | ->process("php $dir/tests/_data/parascript.php gou 2") |
||
71 | ->process("php $dir/tests/_data/parascript.php die 1"); |
||
72 | if ($options['error']) { |
||
73 | $para->process("ls $dir/tests/_data/filenotfound"); |
||
74 | } |
||
75 | return $para->run(); |
||
76 | } |
||
77 | |||
78 | /** |
||
79 | * try:opt-required |
||
80 | */ |
||
81 | public function tryOptRequired($options = ['foo' => InputOption::VALUE_REQUIRED]) |
||
82 | { |
||
83 | print "foo is " . $options['foo']; |
||
84 | } |
||
85 | |||
86 | /** |
||
87 | * Demonstrates Robo argument passing. |
||
88 | * |
||
89 | * @param string $a The first parameter. Required. |
||
90 | * @param string $b The second parameter. Optional. |
||
91 | */ |
||
92 | public function tryArgs($a, $b = 'default') |
||
93 | { |
||
94 | $this->say("The parameter a is $a and b is $b"); |
||
95 | } |
||
96 | |||
97 | /** |
||
98 | * Demonstrate Robo variable argument passing. |
||
99 | * |
||
100 | * @param $a A list of commandline parameters. |
||
101 | */ |
||
102 | public function tryArrayArgs(array $a) |
||
103 | { |
||
104 | $this->say("The parameters passed are:\n" . var_export($a, true)); |
||
105 | } |
||
106 | |||
107 | /** |
||
108 | * Demonstrate Robo boolean options. |
||
109 | * |
||
110 | * @param $opts The options. |
||
111 | * @option boolean $silent Supress output. |
||
112 | */ |
||
113 | public function tryOptbool($opts = ['silent|s' => false]) |
||
114 | { |
||
115 | if (!$opts['silent']) { |
||
116 | $this->say("Hello, world"); |
||
117 | } |
||
118 | } |
||
119 | |||
120 | /** |
||
121 | * Demonstrate the use of the PHP built-in webserver. |
||
122 | */ |
||
123 | public function tryServer() |
||
124 | { |
||
125 | return $this->taskServer(8000) |
||
126 | ->dir('site') |
||
127 | ->arg('site/index.php') |
||
128 | ->run(); |
||
129 | } |
||
130 | |||
131 | /** |
||
132 | * Demonstrate the use of the Robo open-browser task. |
||
133 | */ |
||
134 | public function tryOpenBrowser() |
||
135 | { |
||
136 | return $this->taskOpenBrowser([ |
||
137 | 'http://robo.li', |
||
138 | 'https://github.com/consolidation-org/Robo' |
||
139 | ])->run(); |
||
140 | } |
||
141 | |||
142 | /** |
||
143 | * Demonstrate Robo error output and command failure. |
||
144 | */ |
||
145 | public function tryError() |
||
146 | { |
||
147 | return $this->taskExec('ls xyzzy' . date('U'))->dir('/tmp')->run(); |
||
148 | } |
||
149 | |||
150 | /** |
||
151 | * Demonstrate Robo standard output and command success. |
||
152 | */ |
||
153 | public function trySuccess() |
||
154 | { |
||
155 | return $this->_exec('pwd'); |
||
156 | } |
||
157 | |||
158 | /** |
||
159 | * @field-labels |
||
160 | * name: Name |
||
161 | * species: Species |
||
162 | * legs: Legs |
||
163 | * food: Favorite Food |
||
164 | * id: Id |
||
165 | * @return PropertyList |
||
166 | */ |
||
167 | public function tryInfo() |
||
168 | { |
||
169 | $outputData = [ |
||
170 | 'name' => 'fluffy', |
||
171 | 'species' => 'cat', |
||
172 | 'legs' => 4, |
||
173 | 'food' => 'salmon', |
||
174 | 'id' => 389245032, |
||
175 | ]; |
||
176 | |||
177 | $data = new PropertyList($outputData); |
||
178 | |||
179 | // Add a render function to transform cell data when the output |
||
180 | // format is a table, or similar. This allows us to add color |
||
181 | // information to the output without modifying the data cells when |
||
182 | // using yaml or json output formats. |
||
183 | $data->addRendererFunction( |
||
184 | // n.b. There is a fourth parameter $rowData that may be added here. |
||
185 | function ($key, $cellData, FormatterOptions $options) { |
||
0 ignored issues
–
show
|
|||
186 | if ($key == 'name') { |
||
187 | return "<info>$cellData</>"; |
||
188 | } |
||
189 | return $cellData; |
||
190 | } |
||
191 | ); |
||
192 | |||
193 | return $data; |
||
194 | } |
||
195 | |||
196 | /** |
||
197 | * Demonstrate Robo formatters. Default format is 'table'. |
||
198 | * |
||
199 | * @field-labels |
||
200 | * first: I |
||
201 | * second: II |
||
202 | * third: III |
||
203 | * @default-string-field second |
||
204 | * @usage try:formatters --format=yaml |
||
205 | * @usage try:formatters --format=csv |
||
206 | * @usage try:formatters --fields=first,third |
||
207 | * @usage try:formatters --fields=III,II |
||
208 | * @aliases tf |
||
209 | * |
||
210 | * @return \Consolidation\OutputFormatters\StructuredData\RowsOfFields |
||
211 | */ |
||
212 | public function tryFormatters($somthing = 'default', $options = ['format' => 'table', 'fields' => '']) |
||
0 ignored issues
–
show
|
|||
213 | { |
||
214 | $outputData = [ |
||
215 | 'en' => [ 'first' => 'One', 'second' => 'Two', 'third' => 'Three' ], |
||
216 | 'de' => [ 'first' => 'Eins', 'second' => 'Zwei', 'third' => 'Drei' ], |
||
217 | 'jp' => [ 'first' => 'Ichi', 'second' => 'Ni', 'third' => 'San' ], |
||
218 | 'es' => [ 'first' => 'Uno', 'second' => 'Dos', 'third' => 'Tres' ], |
||
219 | ]; |
||
220 | return new RowsOfFields($outputData); |
||
221 | } |
||
222 | |||
223 | /** |
||
224 | * Try word wrapping |
||
225 | * |
||
226 | * @field-labels |
||
227 | * first: First |
||
228 | * second: Second |
||
229 | * |
||
230 | * @return \Consolidation\OutputFormatters\StructuredData\RowsOfFields |
||
231 | */ |
||
232 | public function tryWrap() |
||
233 | { |
||
234 | $data = [ |
||
235 | [ |
||
236 | 'first' => 'This is a really long cell that contains a lot of data. When it is rendered, it should be wrapped across multiple lines.', |
||
237 | 'second' => 'This is the second column of the same table. It is also very long, and should be wrapped across multiple lines, just like the first column.', |
||
238 | ] |
||
239 | ]; |
||
240 | return new RowsOfFields($data); |
||
241 | } |
||
242 | |||
243 | /** |
||
244 | * Demonstrate an alter hook with an option |
||
245 | * |
||
246 | * @hook alter try:formatters |
||
247 | * @option $french Add a row with French numbers. |
||
248 | * @usage try:formatters --french |
||
249 | */ |
||
250 | public function alterFormatters($result, CommandData $commandData) |
||
251 | { |
||
252 | if ($commandData->input()->getOption('french')) { |
||
253 | $result['fr'] = [ 'first' => 'Un', 'second' => 'Deux', 'third' => 'Trois' ]; |
||
254 | } |
||
255 | |||
256 | return $result; |
||
257 | } |
||
258 | |||
259 | /** |
||
260 | * Demonstrate what happens when a command or a task |
||
261 | * throws an exception. Note that typically, Robo commands |
||
262 | * should return Result objects rather than throw exceptions. |
||
263 | */ |
||
264 | public function tryException($options = ['task' => false]) |
||
265 | { |
||
266 | if (!$options['task']) { |
||
267 | throw new RuntimeException('Command failed with an exception.'); |
||
268 | } |
||
269 | return new ExceptionTask('Task failed with an exception.'); |
||
270 | } |
||
271 | |||
272 | /** |
||
273 | * Demonstrate deprecated task behavior. |
||
274 | * |
||
275 | * Demonstrate what happens when using a task that is created via |
||
276 | * direct instantiation, which omits initialization done by the |
||
277 | * container. Emits a warning message. |
||
278 | */ |
||
279 | public function tryDeprecated() |
||
280 | { |
||
281 | // Calling 'new' directly without manually setting |
||
282 | // up dependencies will result in a deprecation warning. |
||
283 | // @see RoboFile::trySuccess() |
||
0 ignored issues
–
show
Unused Code
Comprehensibility
introduced
by
38% of this comment could be valid code. Did you maybe forget this after debugging?
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it. The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production. This check looks for comments that seem to be mostly valid code and reports them.
Loading history...
|
|||
284 | return (new \Robo\Task\Base\Exec('pwd'))->run(); |
||
285 | } |
||
286 | |||
287 | /** |
||
288 | * Demonstrate the use of a collection builder to chain multiple tasks |
||
289 | * together into a collection, which is executed once constructed. |
||
290 | * |
||
291 | * For demonstration purposes only; this could, of course, be done |
||
292 | * with a single FilesystemStack. |
||
293 | */ |
||
294 | public function tryBuilder() |
||
295 | { |
||
296 | return $this->collectionBuilder() |
||
0 ignored issues
–
show
The method
taskFilesystemStack does not exist on object<Robo\Collection\CollectionBuilder> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
Loading history...
|
|||
297 | ->taskFilesystemStack() |
||
298 | ->mkdir('a') |
||
299 | ->touch('a/a.txt') |
||
300 | ->taskFilesystemStack() |
||
301 | ->mkdir('a/b') |
||
302 | ->touch('a/b/b.txt') |
||
303 | ->taskFilesystemStack() |
||
304 | ->mkdir('a/b/c') |
||
305 | ->touch('a/b/c/c.txt') |
||
306 | ->run(); |
||
307 | } |
||
308 | |||
309 | public function tryState() |
||
310 | { |
||
311 | return $this->collectionBuilder() |
||
0 ignored issues
–
show
The method
taskExec does not exist on object<Robo\Collection\CollectionBuilder> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
Loading history...
|
|||
312 | ->taskExec('uname -n') |
||
313 | ->printOutput(false) |
||
314 | ->storeState('system-name') |
||
315 | ->taskFilesystemStack() |
||
316 | ->deferTaskConfiguration('mkdir', 'system-name') |
||
317 | ->run(); |
||
318 | } |
||
319 | |||
320 | public function tryBuilderRollback() |
||
321 | { |
||
322 | // This example will create two builders, and add |
||
323 | // the first one as a child of the second in order |
||
324 | // to demonstrate nested rollbacks. |
||
325 | $collection = $this->collectionBuilder() |
||
0 ignored issues
–
show
The method
taskFilesystemStack does not exist on object<Robo\Collection\CollectionBuilder> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
Loading history...
|
|||
326 | ->taskFilesystemStack() |
||
327 | ->mkdir('g') |
||
328 | ->touch('g/g.txt') |
||
329 | ->rollback( |
||
330 | $this->taskDeleteDir('g') |
||
331 | ) |
||
332 | ->taskFilesystemStack() |
||
333 | ->mkdir('g/h') |
||
334 | ->touch('g/h/h.txt') |
||
335 | ->taskFilesystemStack() |
||
336 | ->mkdir('g/h/i/c') |
||
337 | ->touch('g/h/i/i.txt'); |
||
338 | |||
339 | return $this->collectionBuilder() |
||
0 ignored issues
–
show
The method
taskExec does not exist on object<Robo\Collection\CollectionBuilder> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
Loading history...
|
|||
340 | ->progressMessage('Start recursive collection') |
||
341 | ->addTask($collection) |
||
342 | ->progressMessage('Done with recursive collection') |
||
343 | ->taskExec('ls xyzzy' . date('U')) |
||
344 | ->dir('/tmp') |
||
345 | ->run(); |
||
346 | } |
||
347 | |||
348 | public function tryWorkdir() |
||
349 | { |
||
350 | // This example works like tryBuilderRollback, |
||
351 | // but does equivalent operations using a working |
||
352 | // directory. The working directory is deleted on rollback |
||
353 | $collection = $this->collectionBuilder(); |
||
354 | |||
355 | $workdir = $collection->workDir('w'); |
||
356 | |||
357 | $collection |
||
0 ignored issues
–
show
The method
taskFilesystemStack does not exist on object<Robo\Collection\CollectionBuilder> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
Loading history...
|
|||
358 | ->taskFilesystemStack() |
||
359 | ->touch("$workdir/g.txt") |
||
360 | ->taskFilesystemStack() |
||
361 | ->mkdir("$workdir/h") |
||
362 | ->touch("$workdir/h/h.txt") |
||
363 | ->taskFilesystemStack() |
||
364 | ->mkdir("$workdir/h/i/c") |
||
365 | ->touch("$workdir/h/i/i.txt"); |
||
366 | |||
367 | return $this->collectionBuilder() |
||
0 ignored issues
–
show
The method
taskExec does not exist on object<Robo\Collection\CollectionBuilder> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
Loading history...
|
|||
368 | ->progressMessage('Start recursive collection') |
||
369 | ->addTask($collection) |
||
370 | ->progressMessage('Done with recursive collection') |
||
371 | ->taskExec('ls xyzzy' . date('U')) |
||
372 | ->dir('/tmp') |
||
373 | ->run(); |
||
374 | } |
||
375 | |||
376 | /** |
||
377 | * Demonstrates Robo temporary directory usage. |
||
378 | */ |
||
379 | public function tryTmpDir() |
||
380 | { |
||
381 | // Set up a collection to add tasks to |
||
382 | $collection = $this->collectionBuilder(); |
||
383 | |||
384 | // Get a temporary directory to work in. Note that we get a path |
||
385 | // back, but the directory is not created until the task runs. |
||
386 | $tmpPath = $collection->tmpDir(); |
||
387 | |||
388 | $result = $collection |
||
0 ignored issues
–
show
The method
taskWriteToFile does not exist on object<Robo\Collection\CollectionBuilder> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
Loading history...
|
|||
389 | ->taskWriteToFile("$tmpPath/file.txt") |
||
390 | ->line('Example file') |
||
391 | ->run(); |
||
392 | |||
393 | if (is_dir($tmpPath)) { |
||
394 | $this->say("The temporary directory at $tmpPath was not cleaned up after the collection completed."); |
||
395 | } else { |
||
396 | $this->say("The temporary directory at $tmpPath was automatically deleted."); |
||
397 | } |
||
398 | |||
399 | return $result; |
||
400 | } |
||
401 | |||
402 | /** |
||
403 | * Description |
||
404 | * @param $options |
||
405 | * @option delay Miliseconds delay |
||
406 | * @return type |
||
407 | */ |
||
408 | public function tryProgress($options = ['delay' => 500]) |
||
409 | { |
||
410 | $delay = $options['delay']; |
||
411 | $delayUntilProgressStart = \Robo\Robo::config()->get(\Robo\Config::PROGRESS_BAR_AUTO_DISPLAY_INTERVAL); |
||
412 | $this->say("Progress bar will display after $delayUntilProgressStart seconds of activity."); |
||
413 | |||
414 | $processList = range(1, 10); |
||
415 | return $this->collectionBuilder() |
||
0 ignored issues
–
show
The method
taskForEach does not exist on object<Robo\Collection\CollectionBuilder> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
Loading history...
|
|||
416 | ->taskForEach($processList) |
||
417 | ->iterationMessage('Processing {value}') |
||
418 | ->call( |
||
419 | function ($value) use($delay) { |
||
0 ignored issues
–
show
|
|||
420 | // TaskForEach::call should only be used to do |
||
421 | // non-Robo operations. To use Robo tasks in an |
||
422 | // iterator, @see TaskForEach::withBuilder. |
||
423 | usleep($delay * 1000); // delay units: msec, usleep units: usec |
||
424 | } |
||
425 | ) |
||
426 | ->run(); |
||
427 | } |
||
428 | |||
429 | public function tryIter() |
||
430 | { |
||
431 | $workdir = 'build/iter-example'; |
||
432 | $this->say("Creating sample direcories in $workdir."); |
||
433 | |||
434 | $processList = ['cats', 'dogs', 'sheep', 'fish', 'horses', 'cows']; |
||
435 | return $this->collectionBuilder() |
||
0 ignored issues
–
show
The method
taskFilesystemStack does not exist on object<Robo\Collection\CollectionBuilder> ? Since you implemented __call , maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
Loading history...
|
|||
436 | ->taskFilesystemStack() |
||
437 | ->mkdir($workdir) |
||
438 | ->taskCleanDir($workdir) |
||
439 | ->taskForEach($processList) |
||
440 | ->withBuilder( |
||
441 | function ($builder, $key, $value) use ($workdir) { |
||
442 | return $builder |
||
443 | ->taskFilesystemStack() |
||
444 | ->mkdir("$workdir/$value"); |
||
445 | } |
||
446 | ) |
||
447 | ->run(); |
||
448 | } |
||
449 | } |
||
450 | |||
451 | class ExceptionTask extends \Robo\Task\BaseTask |
||
0 ignored issues
–
show
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.
You can fix this by adding a namespace to your class: namespace YourVendor;
class YourClass { }
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.
Loading history...
|
|||
452 | { |
||
453 | protected $message; |
||
454 | |||
455 | public function __construct($message) |
||
456 | { |
||
457 | $this->message = $message; |
||
458 | } |
||
459 | |||
460 | public function run() |
||
461 | { |
||
462 | throw new RuntimeException($this->message); |
||
463 | } |
||
464 | } |
||
465 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.