Completed
Push — master ( 82b45c...643174 )
by Leo
02:15
created

GearmanCommand::run()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 15
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 15
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 12
nc 2
nop 1
1
<?php
2
3
namespace leocata\m1Bot\Commands;
4
5
use leocata\m1Bot\Bot\BaseBot;
6
7
class GearmanCommand
8
{
9
    public static function run(BaseBot $userBot)
10
    {
11
        $worker = new \GearmanWorker();
0 ignored issues
show
Bug introduced by
The type GearmanWorker was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
12
        $worker->addServer();
13
        $worker->addFunction('message', [$userBot, 'message']);
14
        $worker->addFunction('typing', [$userBot, 'typing']);
15
        $worker->addFunction('state', [$userBot, 'state']);
16
        $worker->addFunction('contactRequested', [$userBot, 'contactRequested']);
17
        $worker->addFunction('contactAccepted', [$userBot, 'contactAccepted']);
18
        $worker->addFunction('contactRejected', [$userBot, 'contactRejected']);
19
        $worker->addFunction('delivery', [$userBot, 'delivery']);
20
        $worker->addFunction('messageDeleted', [$userBot, 'messageDeleted']);
21
        $worker->addFunction('read', [$userBot, 'read']);
22
23
        while ($worker->work()) {
24
            //Worker processing
25
        }
26
    }
27
}
28