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.
Completed
Push — master ( 9a7ea4...53d770 )
by Yang
02:32
created

SendMessageRequest   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 58
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 7
c 3
b 0
f 0
lcom 1
cbo 2
dl 0
loc 58
rs 10
1
<?php
2
namespace AliyunMNS\Requests;
3
4
use AliyunMNS\Constants;
5
use AliyunMNS\Requests\BaseRequest;
6
use AliyunMNS\Model\QueueAttributes;
7
use AliyunMNS\Traits\MessagePropertiesForSend;
8
9
class SendMessageRequest extends BaseRequest
10
{
11
    use MessagePropertiesForSend;
12
13
    private $queueName;
14
15
    // boolean, whether the message body will be encoded in base64
16
    private $base64;
17
18
    public function __construct($messageBody, $delaySeconds = NULL, $priority = NULL, $base64 = TRUE)
19
    {
20
        parent::__construct('post', NULL);
21
22
        $this->queueName = NULL;
23
        $this->messageBody = $messageBody;
24
        $this->delaySeconds = $delaySeconds;
25
        $this->priority = $priority;
26
        $this->base64 = $base64;
27
    }
28
29
    public function setBase64($base64)
30
    {
31
        $this->base64 = $base64;
32
    }
33
34
    public function isBase64()
35
    {
36
        return ($this->base64 == TRUE);
37
    }
38
39
    public function setQueueName($queueName)
40
    {
41
        $this->queueName = $queueName;
42
        $this->resourcePath = 'queues/' . $queueName . '/messages';
43
    }
44
45
    public function getQueueName()
46
    {
47
        return $this->queueName;
48
    }
49
50
    public function generateBody()
51
    {
52
        $xmlWriter = new \XMLWriter;
53
        $xmlWriter->openMemory();
54
        $xmlWriter->startDocument("1.0", "UTF-8");
55
        $xmlWriter->startElementNS(NULL, "Message", Constants::MNS_XML_NAMESPACE);
56
        $this->writeMessagePropertiesForSendXML($xmlWriter, $this->base64);
57
        $xmlWriter->endElement();
58
        $xmlWriter->endDocument();
59
        return $xmlWriter->outputMemory();
60
    }
61
62
    public function generateQueryString()
63
    {
64
        return NULL;
65
    }
66
}
67
?>
68