Passed
Push — develop ( 368e3d...115c7b )
by Nikolay
12:16
created

GetController   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 2
c 0
b 0
f 0
dl 0
loc 16
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A callAction() 0 3 1
1
<?php
2
/*
3
 * MikoPBX - free phone system for small business
4
 * Copyright © 2017-2023 Alexey Portnov and Nikolay Beketov
5
 *
6
 * This program is free software: you can redistribute it and/or modify
7
 * it under the terms of the GNU General Public License as published by
8
 * the Free Software Foundation; either version 3 of the License, or
9
 * (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License along with this program.
17
 * If not, see <https://www.gnu.org/licenses/>.
18
 */
19
20
namespace MikoPBX\PBXCoreREST\Controllers\Advice;
21
22
use MikoPBX\PBXCoreREST\Controllers\BaseController;
23
use MikoPBX\PBXCoreREST\Lib\AdviceProcessor;
24
25
/**
26
 * Controller for handling advice and notifications related actions.
27
 *
28
 * @RoutePrefix("/pbxcore/api/advice")
29
 *
30
 * @package MikoPBX\PBXCoreREST\Controllers\Advice
31
 *
32
 * @example
33
 *
34
 * curl http://127.0.0.1/pbxcore/api/advice/getList;
35
 *
36
 */
37
class GetController extends BaseController
38
{
39
    /**
40
     * This method retrieves the list of notifications regarding the system, firewall, passwords, and wrong settings.
41
     * The following command can be used to invoke this action:
42
     *
43
     * @param string $actionName The name of the action.
44
     *
45
     * Generates a list of notifications about the system, firewall, passwords, and wrong settings.
46
     * @Get("/getList")
47
     *
48
     * @return void
49
     */
50
    public function callAction(string $actionName): void
51
    {
52
        $this->sendRequestToBackendWorker(AdviceProcessor::class, $actionName, [],'', 10, 2048);
53
    }
54
}