Completed
Push — 2.0 ( 29c56f...2f2bc4 )
by Marco
14:43
created

SocketInjector   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 4
dl 0
loc 37
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B inject() 0 33 1
1
<?php namespace Comodojo\Extender\Socket;
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
        $schedule_commands = new ScheduleCommands();
26
        $queue_commands = new QueueCommands();
27
        $worklog_commands = new WorklogCommands();
28
29
        $commands
30
            // add schedule commands
31
            ->add('scheduler:refresh', [$schedule_commands, 'schedulerRefresh'])
32
            ->add('scheduler:add', [$schedule_commands, 'schedulerAdd'])
33
            ->add('scheduler:get', [$schedule_commands, 'schedulerGet'])
34
            ->add('scheduler:getByName', [$schedule_commands, 'schedulerGetByName'])
35
            ->add('scheduler:edit', [$schedule_commands, 'schedulerEdit'])
36
            ->add('scheduler:remove', [$schedule_commands, 'schedulerRemove'])
37
            ->add('scheduler:removeByName', [$schedule_commands, 'schedulerRemoveByName'])
38
            ->add('scheduler:enable', [$schedule_commands, 'schedulerEnable'])
39
            ->add('scheduler:enableByName', [$schedule_commands, 'schedulerEnableByName'])
40
            ->add('scheduler:disable', [$schedule_commands, 'schedulerDisable'])
41
            ->add('scheduler:disableByName', [$schedule_commands, 'schedulerDisableByName'])
42
            ->add('scheduler:info', [$schedule_commands, 'schedulerInfo'])
43
            // add queue commands
44
            ->add('queue:add', [$queue_commands, 'queueAdd'])
45
            ->add('queue:addBulk', [$queue_commands, 'queueAddBulk'])
46
            ->add('queue:info', [$queue_commands, 'queueInfo'])
47
            // add worklog commands
48
            ->add('worklog:count', [$worklog_commands, 'count'])
49
            ->add('worklog:list', [$worklog_commands, 'list'])
50
            ->add('worklog:getById', [$worklog_commands, 'byId'])
51
            ->add('worklog:getByJid', [$worklog_commands, 'byJid'])
52
            ->add('worklog:getByUid', [$worklog_commands, 'byUid'])
53
            ->add('worklog:getByPid', [$worklog_commands, 'byPid'])
54
            ->add('worklog:getByUid', [$worklog_commands, 'byUid']);
55
    }
56
57
}
58