1 | <?php |
||
9 | class Runner |
||
10 | { |
||
11 | /** |
||
12 | * A collection of failed checkers. |
||
13 | * |
||
14 | * @var \Illuminate\Support\Collection |
||
15 | */ |
||
16 | private $failed; |
||
17 | |||
18 | /** |
||
19 | * A collection of passing checkers. |
||
20 | * |
||
21 | * @var \Illuminate\Support\Collection |
||
22 | */ |
||
23 | private $passes; |
||
24 | |||
25 | /** |
||
26 | * Boolean wether to use the scheduling. |
||
27 | * |
||
28 | * @var bool |
||
29 | */ |
||
30 | private $scheduled = true; |
||
31 | |||
32 | /** |
||
33 | * Collection of executors. |
||
34 | * |
||
35 | * @var \Illuminate\Support\Collection |
||
36 | */ |
||
37 | private $executors; |
||
38 | |||
39 | /** |
||
40 | * Creates an instance with the given executors. |
||
41 | * |
||
42 | * @param array|\Illuminate\Support\Collection $executors |
||
43 | */ |
||
44 | public function __construct($executors) |
||
48 | |||
49 | /** |
||
50 | * Creates an instance of this class with the configured checkers. |
||
51 | * |
||
52 | * @return \Pbmedia\ApiHealth\Runner |
||
53 | */ |
||
54 | public static function fromConfig(): Runner |
||
64 | |||
65 | /** |
||
66 | * Disables the scheduling. |
||
67 | * |
||
68 | * @return $this |
||
69 | */ |
||
70 | public function ignoreScheduling() |
||
76 | |||
77 | /** |
||
78 | * Handles all the checkers if that has not been done yet and |
||
79 | * returns the collection of passing checkers. |
||
80 | * |
||
81 | * @return \Illuminate\Support\Collection |
||
82 | */ |
||
83 | public function passes(): Collection |
||
91 | |||
92 | /** |
||
93 | * Handles all the checkers if that has not been done yet and |
||
94 | * returns the collection of failed checkers. |
||
95 | * |
||
96 | * @return \Illuminate\Support\Collection |
||
97 | */ |
||
98 | public function failed(): Collection |
||
106 | |||
107 | /** |
||
108 | * Clears both collections and runs through all the configured checkers. |
||
109 | * |
||
110 | * @return $this |
||
111 | */ |
||
112 | public function handle() |
||
134 | } |
||
135 |