1 | <?php |
||
11 | class Manager |
||
12 | { |
||
13 | /** |
||
14 | * The application instance. |
||
15 | * |
||
16 | * @var \Illuminate\Contracts\Container\Container |
||
17 | */ |
||
18 | protected $app; |
||
19 | |||
20 | /** |
||
21 | * The EasyRSA connection factory instance. |
||
22 | * |
||
23 | * @var \EasyRSA\Laravel\Factory |
||
24 | */ |
||
25 | protected $factory; |
||
26 | |||
27 | /** |
||
28 | * The active worker instances. |
||
29 | * |
||
30 | * @var array |
||
31 | */ |
||
32 | protected $workers = []; |
||
33 | |||
34 | /** |
||
35 | * @param \Illuminate\Contracts\Container\Container $app |
||
36 | * @param \EasyRSA\Laravel\Factory $factory |
||
37 | */ |
||
38 | public function __construct(Container $app, Factory $factory) |
||
43 | |||
44 | /** |
||
45 | * Get the default worker. |
||
46 | * |
||
47 | * @return string |
||
48 | */ |
||
49 | public function getDefaultWorker(): string |
||
53 | |||
54 | /** |
||
55 | * Set the default worker. |
||
56 | * |
||
57 | * @param string $connection |
||
58 | */ |
||
59 | public function setDefaultWorker(string $connection): void |
||
63 | |||
64 | /** |
||
65 | * Get the configuration for a named worker. |
||
66 | * |
||
67 | * @param string $name |
||
68 | * |
||
69 | * @return array |
||
70 | * @throws \InvalidArgumentException |
||
71 | */ |
||
72 | protected function getConfig(string $name): array |
||
82 | |||
83 | /** |
||
84 | * Make a new worker. |
||
85 | * |
||
86 | * @param string $name |
||
87 | * |
||
88 | * @return \EasyRSA\Worker |
||
89 | */ |
||
90 | protected function makeWorker(string $name): Worker |
||
96 | |||
97 | /** |
||
98 | * Return all of the created workers. |
||
99 | * |
||
100 | * @return array |
||
101 | */ |
||
102 | public function getWorkers(): array |
||
106 | |||
107 | /** |
||
108 | * Instantiate worker object |
||
109 | * |
||
110 | * @param string|null $name |
||
111 | * |
||
112 | * @return \EasyRSA\Interfaces\WorkerInterface |
||
113 | */ |
||
114 | public function worker(string $name = null): WorkerInterface |
||
126 | |||
127 | /** |
||
128 | * Dynamically pass methods to the default worker. |
||
129 | * |
||
130 | * @param string $method |
||
131 | * @param array $parameters |
||
132 | * |
||
133 | * @return mixed |
||
134 | */ |
||
135 | public function __call(string $method, array $parameters) |
||
139 | } |
||
140 |