| 1 | <?php |
||
| 8 | class Pass { |
||
| 9 | /** |
||
| 10 | * The control of which this is a pass |
||
| 11 | * |
||
| 12 | * @var \Drupal\qa\Plugin\Qa\Control\BaseControl |
||
| 13 | */ |
||
| 14 | public $control; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * The user who ran the pass. |
||
| 18 | * |
||
| 19 | * This is normally a stdClass with a $uid public member. |
||
| 20 | * |
||
| 21 | * @var object |
||
| 22 | */ |
||
| 23 | public $account; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * The pass lifecycle |
||
| 27 | * |
||
| 28 | * @var \Drupal\qa\Same |
||
| 29 | */ |
||
| 30 | public $life; |
||
| 31 | |||
| 32 | /** |
||
| 33 | * Success or failure |
||
| 34 | * |
||
| 35 | * @var int |
||
| 36 | * - NULL: undefined |
||
| 37 | * - 0: failure |
||
| 38 | * - 1: success |
||
| 39 | */ |
||
| 40 | public $status; |
||
| 41 | |||
| 42 | /** |
||
| 43 | * Render array for the results |
||
| 44 | * |
||
| 45 | * @param array |
||
| 46 | */ |
||
| 47 | public $result; |
||
| 48 | |||
| 49 | /** |
||
| 50 | * @param \Drupal\qa\Plugin\Qa\Control\BaseControl $control |
||
| 51 | */ |
||
| 52 | function __construct($control) { |
||
| 59 | |||
| 60 | /** |
||
| 61 | * Record results from one of the checks in a control pass |
||
| 62 | * |
||
| 63 | * @param array $check |
||
| 64 | * - status: 0 or 1 |
||
| 65 | * - result: render array |
||
| 66 | * |
||
| 67 | * @return void |
||
| 68 | */ |
||
| 69 | function record($check) { |
||
| 84 | } |
||
| 85 |
Adding explicit visibility (
private,protected, orpublic) is generally recommend to communicate to other developers how, and from where this method is intended to be used.