GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Message::cancel()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
/**
3
 * This file is part of the mucts.com.
4
 *
5
 * This source file is subject to the MIT license that is bundled
6
 * with this source code in the file LICENSE.
7
 *
8
 * @version 1.0
9
 * @author herry<[email protected]>
10
 * @copyright © 2020  MuCTS.com All Rights Reserved.
11
 */
12
13
namespace MuCTS\Laravel\AMQP;
14
15
16
use PhpAmqpLib\Message\AMQPMessage;
17
18
/**
19
 * Class Message
20
 *
21
 * @mixin AMQPMessage
22
 * @package MuCTS\Laravel\AMQP
23
 */
24
class Message
25
{
26
    private AMQPMessage $message;
27
28
    public function __construct(AMQPMessage $message)
29
    {
30
        $this->message = $message;
31
    }
32
33
    /**
34
     * Acknowledges one or more messages
35
     */
36
    public function ack()
37
    {
38
        $this->message->delivery_info['channel']->basic_ack($this->message->delivery_info['delivery_tag']);
39
    }
40
41
    /**
42
     *  Rejects one or several received messages
43
     */
44
    public function nack()
45
    {
46
        $this->message->delivery_info['channel']->basic_nack($this->message->delivery_info['delivery_tag']);
47
    }
48
49
    /**
50
     * Send a message cancel the consumer.
51
     */
52
    public function cancel()
53
    {
54
        $this->message->delivery_info['channel']->basic_cancel($this->message->delivery_info['consumer_tag']);
55
    }
56
57
    /**
58
     * Get AMQPMessage
59
     *
60
     * @return AMQPMessage
61
     */
62
    public function getMessage(){
63
        return $this->message;
64
    }
65
66
    /**
67
     * Dynamically pass methods to the message.
68
     *
69
     * @param string $method
70
     * @param array $arguments
71
     * @return mixed
72
     */
73
    public function __call($method, $arguments)
74
    {
75
        return $this->message->{$method}(...$arguments);
76
    }
77
78
    /**
79
     * Dynamically pass value to the message.
80
     *
81
     * @param string $name
82
     * @return mixed
83
     */
84
    public function __get($name)
85
    {
86
        return $this->message->{$name};
87
    }
88
}