|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace leocata\m1Bot\Abstracts; |
|
4
|
|
|
|
|
5
|
|
|
use leocata\M1\Api; |
|
6
|
|
|
use leocata\m1Bot\Bot\BaseBot; |
|
7
|
|
|
|
|
8
|
|
|
abstract class MessageEvent |
|
9
|
|
|
{ |
|
10
|
|
|
|
|
11
|
|
|
private $method; |
|
12
|
|
|
private $apiWrapper; |
|
13
|
|
|
private $worker; |
|
14
|
|
|
private $auth; |
|
15
|
|
|
|
|
16
|
|
|
/** |
|
17
|
|
|
* MessageEvent constructor. |
|
18
|
|
|
*/ |
|
19
|
|
|
final public function __construct() |
|
20
|
|
|
{ |
|
21
|
|
|
|
|
22
|
|
|
$this->auth = (new BaseBot())->getAuth(); |
|
23
|
|
|
$this->apiWrapper = new Api(); |
|
24
|
|
|
$this->worker = new \GearmanWorker(); |
|
|
|
|
|
|
25
|
|
|
$this->worker->addServer(); |
|
26
|
|
|
$this->worker->addFunction('message', [$this, 'message']); |
|
27
|
|
|
$this->worker->addFunction('typing', [$this, 'typing']); |
|
28
|
|
|
$this->worker->addFunction('state', [$this, 'state']); |
|
29
|
|
|
$this->worker->addFunction('contactRequested', [$this, 'contactRequested']); |
|
30
|
|
|
$this->worker->addFunction('contactAccepted', [$this, 'contactAccepted']); |
|
31
|
|
|
$this->worker->addFunction('contactRejected', [$this, 'contactRejected']); |
|
32
|
|
|
$this->worker->addFunction('delivery', [$this, 'delivery']); |
|
33
|
|
|
$this->worker->addFunction('messageDeleted', [$this, 'messageDeleted']); |
|
34
|
|
|
$this->worker->addFunction('read', [$this, 'read']); |
|
35
|
|
|
} |
|
36
|
|
|
|
|
37
|
|
|
public function getMethod() |
|
38
|
|
|
{ |
|
39
|
|
|
return $this->method; |
|
40
|
|
|
} |
|
41
|
|
|
|
|
42
|
|
|
abstract public function contactAccepted(\GearmanJob $job); |
|
|
|
|
|
|
43
|
|
|
|
|
44
|
|
|
abstract public function contactRejected(\GearmanJob $job); |
|
45
|
|
|
|
|
46
|
|
|
abstract public function contactRequested(\GearmanJob $job); |
|
47
|
|
|
|
|
48
|
|
|
abstract public function delivery(\GearmanJob $job); |
|
49
|
|
|
|
|
50
|
|
|
abstract public function message(\GearmanJob $job); |
|
51
|
|
|
|
|
52
|
|
|
abstract public function messageDeleted(\GearmanJob $job); |
|
53
|
|
|
|
|
54
|
|
|
abstract public function read(\GearmanJob $job); |
|
55
|
|
|
|
|
56
|
|
|
abstract public function state(\GearmanJob $job); |
|
57
|
|
|
|
|
58
|
|
|
abstract public function typing(\GearmanJob $job); |
|
59
|
|
|
|
|
60
|
|
|
final public function run() |
|
61
|
|
|
{ |
|
62
|
|
|
while ($this->worker->work()) { |
|
63
|
|
|
//Worker processing |
|
64
|
|
|
} |
|
65
|
|
|
} |
|
66
|
|
|
} |
|
67
|
|
|
|
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:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths