Issues (14)

src/Chips/TMCommands.php (1 issue)

Labels
Severity
1
<?php
2
/**
3
 * Type message commands
4
 * User: moyo
5
 * Date: 02/03/2018
6
 * Time: 2:40 PM
7
 */
8
9
namespace Carno\NSQ\Chips;
10
11
use Carno\NSQ\Connector\Nsqd;
12
13
trait TMCommands
14
{
15
    /**
16
     * @var Nsqd
17
     */
18
    private $link = null;
19
20
    /**
21
     * @param Nsqd $nsqd
22
     * @return static
23
     */
24
    public function link(Nsqd $nsqd) : self
25
    {
26
        $this->link = $nsqd;
27
        return $this;
28
    }
29
30
    /**
31
     */
32
    public function done() : void
33
    {
34
        $this->link->fin($this->id());
0 ignored issues
show
It seems like id() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

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

34
        $this->link->fin($this->/** @scrutinizer ignore-call */ id());
Loading history...
35
    }
36
37
    /**
38
     * delayed in milliseconds
39
     * @param int $delayed
40
     */
41
    public function retry(int $delayed = 0) : void
42
    {
43
        $this->link->req($this->id(), $delayed);
44
    }
45
}
46