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.
Passed
Push — master ( d63410...ab5027 )
by herry
03:41
created

Message   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 55
Duplicated Lines 0 %

Importance

Changes 2
Bugs 1 Features 0
Metric Value
eloc 8
c 2
b 1
f 0
dl 0
loc 55
rs 10
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A ack() 0 3 1
A __construct() 0 3 1
A cancel() 0 3 1
A getMessage() 0 2 1
A __call() 0 3 1
A __get() 0 3 1
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
     * Send a message ack the consumer.
35
     */
36
    public function ack()
37
    {
38
        $this->message->delivery_info['channel']->basic_ack($this->message->delivery_info['delivery_tag']);
39
    }
40
41
    /**
42
     * Send a message cancel the consumer.
43
     */
44
    public function cancel()
45
    {
46
        $this->message->delivery_info['channel']->basic_cancel($this->message->delivery_info['consumer_tag']);
47
    }
48
49
    /**
50
     * Get AMQPMessage
51
     *
52
     * @return AMQPMessage
53
     */
54
    public function getMessage(){
55
        return $this->message;
56
    }
57
58
    /**
59
     * Dynamically pass methods to the message.
60
     *
61
     * @param string $method
62
     * @param array $arguments
63
     * @return mixed
64
     */
65
    public function __call($method, $arguments)
66
    {
67
        return $this->message->{$method}(...$arguments);
68
    }
69
70
    /**
71
     * Dynamically pass value to the message.
72
     *
73
     * @param string $name
74
     * @return mixed
75
     */
76
    public function __get($name)
77
    {
78
        return $this->message->{$name};
79
    }
80
}