Yaffs site version 1.1
[yaffs-website] / vendor / drupal / console-core / src / Utils / ChainQueue.php
1 <?php
2
3 /**
4  * @file
5  * Contains Drupal\Console\Core\Utils\ChainQueue.
6  */
7
8 namespace Drupal\Console\Core\Utils;
9
10 /**
11  * Class ChainQueue
12  *
13  * @package Drupal\Console\Core\Helper
14  */
15 class ChainQueue
16 {
17     /**
18      * @var $commands array
19      */
20     private $commands;
21
22     /**
23      * @param $name             string
24      * @param $inputs           array
25      * @param $interactive      boolean
26      * @param $learning         boolean
27      */
28     public function addCommand(
29         $name,
30         $inputs = [],
31         $interactive = null,
32         $learning = null
33     ) {
34         $inputs['command'] = $name;
35         if (!is_null($learning)) {
36             $inputs['--learning'] = $learning;
37         }
38         $this->commands[] =
39             [
40                 'name' => $name,
41                 'inputs' => $inputs,
42                 'interactive' => $interactive
43             ];
44     }
45
46     /**
47      * @return array
48      */
49     public function getCommands()
50     {
51         return $this->commands;
52     }
53 }