1 | <?php |
||
7 | class Modules implements RepositoryInterface |
||
8 | { |
||
9 | /** |
||
10 | * @var Application |
||
11 | */ |
||
12 | protected $app; |
||
13 | |||
14 | /** |
||
15 | * @var RepositoryInterface |
||
16 | */ |
||
17 | protected $repository; |
||
18 | |||
19 | /** |
||
20 | * Create a new Modules instance. |
||
21 | * |
||
22 | * @param Application $app |
||
23 | * @param RepositoryInterface $repository |
||
24 | 1 | */ |
|
25 | public function __construct(Application $app, RepositoryInterface $repository) |
||
26 | 1 | { |
|
27 | 1 | $this->app = $app; |
|
28 | 1 | $this->repository = $repository; |
|
29 | } |
||
30 | |||
31 | /** |
||
32 | * Register the module service provider file from all modules. |
||
33 | * |
||
34 | * @return mixed |
||
35 | */ |
||
36 | public function register() |
||
46 | |||
47 | /** |
||
48 | * Register the module service provider. |
||
49 | * |
||
50 | * @param string $properties |
||
51 | * @return string |
||
52 | * @throws \Caffeinated\Modules\Exception\FileMissingException |
||
53 | */ |
||
54 | protected function registerServiceProvider($properties) |
||
62 | |||
63 | /** |
||
64 | * Autoload custom module files. |
||
65 | * |
||
66 | * @param array $properties |
||
67 | * @return void |
||
68 | */ |
||
69 | protected function autoloadFiles($properties) |
||
80 | |||
81 | public function optimize() |
||
85 | |||
86 | /** |
||
87 | * Get all modules. |
||
88 | * |
||
89 | * @return Collection |
||
90 | */ |
||
91 | public function all() |
||
95 | |||
96 | /** |
||
97 | * Get all module slugs. |
||
98 | * |
||
99 | * @return array |
||
100 | */ |
||
101 | public function slugs() |
||
105 | |||
106 | /** |
||
107 | * Get modules based on where clause. |
||
108 | * |
||
109 | * @param string $key |
||
110 | * @param mixed $value |
||
111 | * @return Collection |
||
112 | */ |
||
113 | public function where($key, $value) |
||
117 | |||
118 | /** |
||
119 | * Sort modules by given key in ascending order. |
||
120 | * |
||
121 | * @param string $key |
||
122 | * @return Collection |
||
123 | */ |
||
124 | public function sortBy($key) |
||
128 | |||
129 | /** |
||
130 | * Sort modules by given key in ascending order. |
||
131 | * |
||
132 | * @param string $key |
||
133 | * @return Collection |
||
134 | */ |
||
135 | public function sortByDesc($key) |
||
139 | |||
140 | /** |
||
141 | * Check if the given module exists. |
||
142 | * |
||
143 | * @param string $slug |
||
144 | * @return bool |
||
145 | */ |
||
146 | public function exists($slug) |
||
150 | |||
151 | /** |
||
152 | * Returns count of all modules. |
||
153 | * |
||
154 | * @return int |
||
155 | */ |
||
156 | public function count() |
||
160 | |||
161 | /** |
||
162 | * Get modules path. |
||
163 | * |
||
164 | * @return string |
||
165 | */ |
||
166 | public function getPath() |
||
170 | |||
171 | /** |
||
172 | * Set modules path in "RunTime" mode. |
||
173 | * |
||
174 | * @param string $path |
||
175 | * @return object $this |
||
176 | */ |
||
177 | public function setPath($path) |
||
181 | |||
182 | /** |
||
183 | * Get path for the specified module. |
||
184 | * |
||
185 | * @param string $slug |
||
186 | * @return string |
||
187 | */ |
||
188 | public function getModulePath($slug) |
||
192 | |||
193 | /** |
||
194 | * Get modules namespace. |
||
195 | * |
||
196 | * @return string |
||
197 | */ |
||
198 | public function getNamespace() |
||
202 | |||
203 | /** |
||
204 | * Get a module's properties. |
||
205 | * |
||
206 | * @param string $slug |
||
207 | * @return mixed |
||
208 | */ |
||
209 | public function getManifest($slug) |
||
213 | |||
214 | /** |
||
215 | * Get a module property value. |
||
216 | * |
||
217 | * @param string $property |
||
218 | * @param mixed $default |
||
219 | * @return mixed |
||
220 | */ |
||
221 | public function get($property, $default = null) |
||
225 | |||
226 | /** |
||
227 | * Set a module property value. |
||
228 | * |
||
229 | * @param string $property |
||
230 | * @param mixed $value |
||
231 | * @return bool |
||
232 | */ |
||
233 | public function set($property, $value) |
||
237 | |||
238 | /** |
||
239 | * Gets all enabled modules. |
||
240 | * |
||
241 | * @return array |
||
242 | */ |
||
243 | public function enabled() |
||
247 | |||
248 | /** |
||
249 | * Gets all disabled modules. |
||
250 | * |
||
251 | * @return array |
||
252 | */ |
||
253 | public function disabled() |
||
257 | |||
258 | /** |
||
259 | * Check if specified module is enabled. |
||
260 | * |
||
261 | * @param string $slug |
||
262 | * @return bool |
||
263 | */ |
||
264 | public function isEnabled($slug) |
||
268 | |||
269 | /** |
||
270 | * Check if specified module is disabled. |
||
271 | * |
||
272 | * @param string $slug |
||
273 | * @return bool |
||
274 | */ |
||
275 | public function isDisabled($slug) |
||
279 | |||
280 | /** |
||
281 | * Enables the specified module. |
||
282 | * |
||
283 | * @param string $slug |
||
284 | * @return bool |
||
285 | */ |
||
286 | public function enable($slug) |
||
290 | |||
291 | /** |
||
292 | * Disables the specified module. |
||
293 | * |
||
294 | * @param string $slug |
||
295 | * @return bool |
||
296 | */ |
||
297 | public function disable($slug) |
||
301 | |||
302 | /** |
||
303 | * Resolve the correct module namespace. |
||
304 | * |
||
305 | * @param array $properties |
||
306 | */ |
||
307 | private function resolveNamespace($properties) |
||
314 | } |
||
315 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.