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 ( d13c9c...463153 )
by Charlotte
03:30
created

SSLRequestCommand::resetSequence()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 2
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
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\Commands;
11
12
/**
13
 * SSLRequest command.
14
 * @internal
15
 */
16
class SSLRequestCommand implements CommandInterface {
17
    use \Evenement\EventEmitterTrait;
18
    
19
    /**
20
     * @var \Plasma\Drivers\MySQL\Messages\HandshakeMessage
21
     */
22
    protected $handshake;
23
    
24
    /**
25
     * @var int
26
     */
27
    protected $capability;
28
    
29
    /**
30
     * @var bool
31
     */
32
    protected $finished = false;
33
    
34
    /**
35
     * Constructor.
36
     * @param \Plasma\Drivers\MySQL\Messages\HandshakeMessage  $handshake
37
     * @param int                                              $capability
38
     */
39
    function __construct(\Plasma\Drivers\MySQL\Messages\HandshakeMessage $handshake, int $capability) {
0 ignored issues
show
Unused Code introduced by
The parameter $capability is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

39
    function __construct(\Plasma\Drivers\MySQL\Messages\HandshakeMessage $handshake, /** @scrutinizer ignore-unused */ int $capability) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
40
        $this->handshake = $handshake;
41
    }
42
    
43
    /**
44
     * Get the encoded message for writing to the database connection.
45
     * @return string
46
     */
47
    function getEncodedMessage(): string {
48
        $maxPacketSize = \Plasma\Drivers\MySQL\ProtocolParser::CLIENT_MAX_PACKET_SIZE;
49
        $charsetNumber = \Plasma\Drivers\MySQL\ProtocolParser::CLIENT_CHARSET_NUMBER;
50
        
51
        $packet = \pack('VVc', $this->capability, $maxPacketSize, $charsetNumber);
52
        $packet .= \str_repeat("\x00", 23);
53
        
54
        $this->finished = true;
55
        return $packet;
56
    }
57
    
58
    /**
59
     * Sets the parser state, if necessary. If not, return `-1`.
60
     * @return int
61
     */
62
    function setParserState(): int {
63
        return \Plasma\Drivers\MySQL\ProtocolParser::STATE_HANDSHAKE;
64
    }
65
    
66
    /**
67
     * Sets the command as completed. This state gets reported back to the user.
68
     * @return void
69
     */
70
    function onComplete(): void {
71
        $this->finished = true;
72
        $this->emit('end', array());
73
    }
74
    
75
    /**
76
     * Sets the command as errored. This state gets reported back to the user.
77
     * @param \Throwable  $throwable
78
     * @return void
79
     */
80
    function onError(\Throwable $throwable): void {
81
        $this->finished = true;
82
        $this->emit('error', array($throwable));
83
    }
84
    
85
    /**
86
     * Sends the next received value into the command.
87
     * @param mixed  $value
88
     * @return void
89
     */
90
    function onNext($value): void {
91
        // Nothing to do
92
    }
93
    
94
    /**
95
     * Whether the command has finished.
96
     * @return bool
97
     */
98
    function hasFinished(): bool {
99
        return $this->finished;
100
    }
101
    
102
    /**
103
     * Whether this command sets the connection as busy.
104
     * @return bool
105
     */
106
    function waitForCompletion(): bool {
107
        return false;
108
    }
109
    
110
    /**
111
     * Whether the sequence ID should be resetted.
112
     * @return bool
113
     */
114
    function resetSequence(): bool {
115
        return false;
116
    }
117
}
118