Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / vendor / consolidation / robo / src / Task / Composer / DumpAutoload.php
1 <?php
2 namespace Robo\Task\Composer;
3
4 /**
5  * Composer Dump Autoload
6  *
7  * ``` php
8  * <?php
9  * // simple execution
10  * $this->taskComposerDumpAutoload()->run();
11  *
12  * // dump auto loader with custom path
13  * $this->taskComposerDumpAutoload('path/to/my/composer.phar')
14  *      ->preferDist()
15  *      ->run();
16  *
17  * // optimize autoloader dump with custom path
18  * $this->taskComposerDumpAutoload('path/to/my/composer.phar')
19  *      ->optimize()
20  *      ->run();
21  *
22  * // optimize autoloader dump with custom path and no dev
23  * $this->taskComposerDumpAutoload('path/to/my/composer.phar')
24  *      ->optimize()
25  *      ->noDev()
26  *      ->run();
27  * ?>
28  * ```
29  */
30 class DumpAutoload extends Base
31 {
32     /**
33      * {@inheritdoc}
34      */
35     protected $action = 'dump-autoload';
36
37     /**
38      * @var string
39      */
40     protected $optimize;
41
42     /**
43      * @return $this
44      */
45     public function optimize($optimize = true)
46     {
47         if ($optimize) {
48             $this->option("--optimize");
49         }
50         return $this;
51     }
52
53     /**
54      * {@inheritdoc}
55      */
56     public function run()
57     {
58         $command = $this->getCommand();
59         $this->printTaskInfo('Dumping Autoloader: {command}', ['command' => $command]);
60         return $this->executeCommand($command);
61     }
62 }