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 ( 3db31b...96398e )
by Charlotte
02:14
created

AuthMoreDataMessage   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 55
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 55
ccs 13
cts 13
cp 1
rs 10
c 0
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getID() 0 2 1
A __construct() 0 2 1
A getParser() 0 2 1
A setParserState() 0 2 1
A parseMessage() 0 5 1
1
<?php
2
/**
3
 * Plasma Driver MySQL component
4
 * Copyright 2018 PlasmaPHP, All Rights Reserved
5
 *
6
 * Website: https://github.com/PlasmaPHP
7
 * License: https://github.com/PlasmaPHP/driver-mysql/blob/master/LICENSE
8
*/
9
10
namespace Plasma\Drivers\MySQL\Messages;
11
12
/**
13
 * Represents a Auth More Data Message.
14
 * @internal
15
 */
16
class AuthMoreDataMessage implements \Plasma\Drivers\MySQL\Messages\MessageInterface {
17
    /**
18
     * @var string|null
19
     */
20
    public $authPluginData;
21
    
22
    /**
23
     * @var \Plasma\Drivers\MySQL\ProtocolParser
24
     */
25
    protected $parser;
26
    
27
    /**
28
     * Constructor.
29
     * @param \Plasma\Drivers\MySQL\ProtocolParser  $parser
30
     */
31 5
    function __construct(\Plasma\Drivers\MySQL\ProtocolParser $parser) {
32 5
        $this->parser = $parser;
33 5
    }
34
    
35
    /**
36
     * Get the identifier for the packet.
37
     * @return string
38
     */
39 1
    static function getID(): string {
40 1
        return "\x01";
41
    }
42
    
43
    /**
44
     * Parses the message, once the complete string has been received.
45
     * Returns false if not enough data has been received, or the remaining buffer.
46
     * @param \Plasma\BinaryBuffer  $buffer
47
     * @return bool
48
     * @throws \Plasma\Drivers\MySQL\Messages\ParseException
49
     */
50 1
    function parseMessage(\Plasma\BinaryBuffer $buffer): bool {
51 1
        $this->authPluginData = $buffer->getContents();
52 1
        $buffer->clear();
53
        
54 1
        return true;
55
    }
56
    
57
    /**
58
     * Get the parser which created this message.
59
     * @return \Plasma\Drivers\MySQL\ProtocolParser
60
     */
61 1
    function getParser(): \Plasma\Drivers\MySQL\ProtocolParser {
62 1
        return $this->parser;
63
    }
64
    
65
    /**
66
     * Sets the parser state, if necessary. If not, return `-1`.
67
     * @return int
68
     */
69 1
    function setParserState(): int {
70 1
        return \Plasma\Drivers\MySQL\ProtocolParser::STATE_AUTH;
71
    }
72
}
73