1 | <?php |
||
32 | class ServiceController extends Controller |
||
33 | { |
||
34 | /** |
||
35 | * Returns a listing of all services currently on the system, |
||
36 | * as well as the associated files and the file hashes for |
||
37 | * caching purposes. |
||
38 | * |
||
39 | * @param \Illuminate\Http\Request $request |
||
40 | * @return \Illuminate\Http\JsonResponse |
||
41 | */ |
||
42 | public function listServices(Request $request) |
||
|
|||
43 | { |
||
44 | $response = []; |
||
45 | foreach (Service::all() as $service) { |
||
46 | $response[$service->folder] = [ |
||
47 | 'main.json' => sha1($this->getConfiguration($service->id)->toJson()), |
||
48 | 'index.js' => sha1($service->index_file), |
||
49 | ]; |
||
50 | } |
||
51 | |||
52 | return response()->json($response); |
||
53 | } |
||
54 | |||
55 | /** |
||
56 | * Returns the contents of the requested file for the given service. |
||
57 | * |
||
58 | * @param \Illuminate\Http\Request $request |
||
59 | * @param string $folder |
||
60 | * @param string $file |
||
61 | * @return \Illuminate\Http\JsonResponse|\Illuminate\Http\FileResponse |
||
62 | */ |
||
63 | public function pull(Request $request, $folder, $file) |
||
75 | |||
76 | /** |
||
77 | * Returns a `main.json` file based on the configuration |
||
78 | * of each service option. |
||
79 | * |
||
80 | * @param int $id |
||
81 | * @return \Illuminate\Support\Collection |
||
82 | */ |
||
83 | protected function getConfiguration($id) |
||
100 | } |
||
101 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.