Completed
Push — 2.0 ( 7f0480...29c56f )
by Marco
13:59
created

SocketInjector::inject()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 19
Code Lines 15

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 19
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 15
nc 1
nop 1
1
<?php namespace Comodojo\Extender\Schedule;
2
3
use \Comodojo\Daemon\Socket\Commands;
4
5
/**
6
* @package     Comodojo Extender
7
* @author      Marco Giovinazzi <[email protected]>
8
* @license     MIT
9
*
10
* LICENSE:
11
*
12
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
17
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
18
* THE SOFTWARE.
19
 */
20
21
class SocketInjector {
22
23
    public static function inject(Commands $commands) {
24
25
        $socket_commands = new SocketCommands();
26
27
        $commands
28
            ->add('scheduler:refresh', [$socket_commands, 'schedulerRefresh'])
29
            ->add('scheduler:add', [$socket_commands, 'schedulerAdd'])
30
            ->add('scheduler:get', [$socket_commands, 'schedulerGet'])
31
            ->add('scheduler:getByName', [$socket_commands, 'schedulerGetByName'])
32
            ->add('scheduler:edit', [$socket_commands, 'schedulerEdit'])
33
            ->add('scheduler:remove', [$socket_commands, 'schedulerRemove'])
34
            ->add('scheduler:removeByName', [$socket_commands, 'schedulerRemoveByName'])
35
            ->add('scheduler:enable', [$socket_commands, 'schedulerEnable'])
36
            ->add('scheduler:enableByName', [$socket_commands, 'schedulerEnableByName'])
37
            ->add('scheduler:disable', [$socket_commands, 'schedulerDisable'])
38
            ->add('scheduler:disableByName', [$socket_commands, 'schedulerDisableByName'])
39
            ->add('scheduler:info', [$socket_commands, 'schedulerInfo']);
40
41
    }
42
43
}
44