BaseBot::state()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 1
1
<?php
2
3
namespace leocata\m1Bot\Bot;
4
5
use leocata\M1\Api;
6
use leocata\M1\Authorization;
7
8
abstract class BaseBot
9
{
10
    public $pass;
11
    public $username;
12
    private $auth;
13
    private $apiWrapper;
14
15
    final public function __construct()
16
    {
17
        $this->auth = new Authorization($this->username, $this->pass);
18
        $this->apiWrapper = new Api();
19
        $this->apiWrapper->setAuth($this->auth);
20
    }
21
22
    public function getAuth()
23
    {
24
        return $this->auth;
25
    }
26
27
    public function contactAccepted(\GearmanJob $job)
28
    {
29
        $job->sendComplete(true);
0 ignored issues
show
Bug introduced by
true of type true is incompatible with the type string expected by parameter $result of GearmanJob::sendComplete(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

29
        $job->sendComplete(/** @scrutinizer ignore-type */ true);
Loading history...
30
    }
31
32
    public function contactRejected(\GearmanJob $job)
33
    {
34
        $job->sendComplete(true);
0 ignored issues
show
Bug introduced by
true of type true is incompatible with the type string expected by parameter $result of GearmanJob::sendComplete(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

34
        $job->sendComplete(/** @scrutinizer ignore-type */ true);
Loading history...
35
    }
36
37
    public function contactRequested(\GearmanJob $job)
38
    {
39
        $job->sendComplete(true);
0 ignored issues
show
Bug introduced by
true of type true is incompatible with the type string expected by parameter $result of GearmanJob::sendComplete(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

39
        $job->sendComplete(/** @scrutinizer ignore-type */ true);
Loading history...
40
    }
41
42
    public function delivery(\GearmanJob $job)
43
    {
44
        $job->sendComplete(true);
0 ignored issues
show
Bug introduced by
true of type true is incompatible with the type string expected by parameter $result of GearmanJob::sendComplete(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

44
        $job->sendComplete(/** @scrutinizer ignore-type */ true);
Loading history...
45
    }
46
47
    public function message(\GearmanJob $job)
48
    {
49
        $job->sendComplete(true);
0 ignored issues
show
Bug introduced by
true of type true is incompatible with the type string expected by parameter $result of GearmanJob::sendComplete(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

49
        $job->sendComplete(/** @scrutinizer ignore-type */ true);
Loading history...
50
    }
51
52
    public function messageDeleted(\GearmanJob $job)
53
    {
54
        $job->sendComplete(true);
0 ignored issues
show
Bug introduced by
true of type true is incompatible with the type string expected by parameter $result of GearmanJob::sendComplete(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

54
        $job->sendComplete(/** @scrutinizer ignore-type */ true);
Loading history...
55
    }
56
57
    public function read(\GearmanJob $job)
58
    {
59
        $job->sendComplete(true);
0 ignored issues
show
Bug introduced by
true of type true is incompatible with the type string expected by parameter $result of GearmanJob::sendComplete(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

59
        $job->sendComplete(/** @scrutinizer ignore-type */ true);
Loading history...
60
    }
61
62
    public function state(\GearmanJob $job)
63
    {
64
        $job->sendComplete(true);
0 ignored issues
show
Bug introduced by
true of type true is incompatible with the type string expected by parameter $result of GearmanJob::sendComplete(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

64
        $job->sendComplete(/** @scrutinizer ignore-type */ true);
Loading history...
65
    }
66
67
    public function typing(\GearmanJob $job)
68
    {
69
        $job->sendComplete(true);
0 ignored issues
show
Bug introduced by
true of type true is incompatible with the type string expected by parameter $result of GearmanJob::sendComplete(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

69
        $job->sendComplete(/** @scrutinizer ignore-type */ true);
Loading history...
70
    }
71
72
    /**
73
     * @return Api
74
     */
75
    public function getApiWrapper(): Api
76
    {
77
        return $this->apiWrapper;
78
    }
79
}
80