1 | <?php |
||
8 | abstract class BaseControl extends Exportable { |
||
9 | |||
10 | /** |
||
11 | * The package to which the control belongs |
||
12 | * |
||
13 | * @var string |
||
14 | */ |
||
15 | public $package_name; |
||
16 | |||
17 | /** |
||
18 | * An options hash |
||
19 | * |
||
20 | * @var array |
||
21 | */ |
||
22 | public $options; |
||
23 | |||
24 | /** |
||
25 | * The hash of passes for that control. |
||
26 | * |
||
27 | * @var array |
||
28 | */ |
||
29 | public $passes; |
||
30 | |||
31 | /** |
||
32 | * Singleton-per-child-class data holder. |
||
33 | * |
||
34 | * @var array |
||
35 | */ |
||
36 | protected static $instances = array(); |
||
37 | |||
38 | /** |
||
39 | * Per-package list of instances |
||
40 | * |
||
41 | * @var array |
||
42 | */ |
||
43 | protected static $packages = array(); |
||
44 | |||
45 | public function __construct() { |
||
49 | |||
50 | /** |
||
51 | * Return an array of module dependencies. |
||
52 | * |
||
53 | * @return array |
||
54 | */ |
||
55 | public static function getDependencies() { |
||
58 | |||
59 | public static function getInstance() { |
||
76 | |||
77 | /** |
||
78 | * Returns per-package controls. |
||
79 | * |
||
80 | * @param string $package_name |
||
81 | * If given, only return the list of controls belonging to that package |
||
82 | * |
||
83 | * @return array |
||
84 | * - if $package_name is given, an array of control instances |
||
85 | * - else a package-name-indexed hash of arrays of control instances |
||
86 | */ |
||
87 | public static function getControls($package_name = NULL) { |
||
98 | |||
99 | /** |
||
100 | * Run the control. |
||
101 | * |
||
102 | * @return \Drupal\qa\Pass |
||
103 | * - 0: failure |
||
104 | * - 1: success |
||
105 | */ |
||
106 | public function run() { |
||
112 | |||
113 | } |
||
114 |