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.
Test Failed
Push — master ( 18c025...2702d5 )
by Charlotte
03:32
created

AuthMoreDataMessage   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 55
Duplicated Lines 0 %

Test Coverage

Coverage 16.66%

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 55
ccs 2
cts 12
cp 0.1666
rs 10
c 0
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getParser() 0 2 1
A setParserState() 0 2 1
A parseMessage() 0 4 1
A __construct() 0 2 1
A getID() 0 2 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
    function __construct(\Plasma\Drivers\MySQL\ProtocolParser $parser) {
32
        $this->parser = $parser;
33
    }
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 string  $buffer
47
     * @param \Plasma\Drivers\MySQL\ProtocolParser  $parser
0 ignored issues
show
Coding Style introduced by
Superfluous parameter comment
Loading history...
48
     * @return string|bool
49
     * @throws \Plasma\Drivers\MySQL\Messages\ParseException
50
     */
51
    function parseMessage(string $buffer) {
52
        $this->authPluginData = $buffer;
53
        
54
        return '';
55
    }
56
    
57
    /**
58
     * Get the parser which created this message.
59
     * @return \Plasma\Drivers\MySQL\ProtocolParser
60
     */
61
    function getParser(): \Plasma\Drivers\MySQL\ProtocolParser {
62
        return $this->parser;
63
    }
64
    
65
    /**
66
     * Sets the parser state, if necessary. If not, return `-1`.
67
     * @return int
68
     */
69
    function setParserState(): int {
70
        return \Plasma\Drivers\MySQL\ProtocolParser::STATE_AUTH;
71
    }
72
}
73