Passed
Push — develop ( edb19d...9107ab )
by Nikolay
05:22
created

CoreGetController::callAction()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
/*
4
 * MikoPBX - free phone system for small business
5
 * Copyright © 2017-2023 Alexey Portnov and Nikolay Beketov
6
 *
7
 * This program is free software: you can redistribute it and/or modify
8
 * it under the terms of the GNU General Public License as published by
9
 * the Free Software Foundation; either version 3 of the License, or
10
 * (at your option) any later version.
11
 *
12
 * This program is distributed in the hope that it will be useful,
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 * GNU General Public License for more details.
16
 *
17
 * You should have received a copy of the GNU General Public License along with this program.
18
 * If not, see <https://www.gnu.org/licenses/>.
19
 */
20
21
namespace MikoPBX\PBXCoreREST\Controllers\Modules;
22
23
use MikoPBX\PBXCoreREST\Controllers\BaseController;
24
use MikoPBX\PBXCoreREST\Lib\ModulesManagementProcessor;
25
26
/**
27
 * Handles the GET request for module manipulation actions.
28
 *
29
 * @RoutePrefix("/pbxcore/api/modules/core")
30
 */
31
class CoreGetController extends BaseController
32
{
33
    /**
34
     * Handles the call to different actions based on the action name for core
35
     *
36
     * @param string $actionName The name of the action
37
     *
38
     * Retrieves available modules on MIKO repository.
39
     * @Post("/getAvailableModules")
40
     *
41
     * @return void
42
     */
43
    public function callAction(string $actionName): void
44
    {
45
        $this->sendRequestToBackendWorker(ModulesManagementProcessor::class, $actionName);
46
    }
47
}
48