Skip to content

Commit ee037c6

Browse files
committed
comments update, minor changes
1 parent a7452d6 commit ee037c6

36 files changed

+216
-198
lines changed

src/MySQLReplication/BinLog/BinLogAuth.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
namespace MySQLReplication\BinLog;
44

55
/**
6-
* Class PackAuth
6+
* Class BinLogAuth
7+
* @package MySQLReplication\BinLog
78
*/
89
class BinLogAuth
910
{

src/MySQLReplication/BinLog/BinLogConnect.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
use MySQLReplication\Gtid\GtidCollection;
1111

1212
/**
13-
* Class Connect
13+
* Class BinLogConnect
14+
* @package MySQLReplication\BinLog
1415
*/
1516
class BinLogConnect
1617
{
@@ -151,15 +152,16 @@ public function getPacket($checkForOkByte = true)
151152
public function isWriteSuccessful($packet)
152153
{
153154
$head = ord($packet[0]);
154-
if (in_array($head, $this->packageOkHeader))
155+
if (in_array($head, $this->packageOkHeader, true))
155156
{
156157
return ['status' => true, 'code' => 0, 'msg' => ''];
157158
}
158159
else
159160
{
160161
$error_code = unpack('v', $packet[1] . $packet[2])[1];
161162
$error_msg = '';
162-
for ($i = 9; $i < strlen($packet); $i++)
163+
$packetLength = strlen($packet);
164+
for ($i = 9; $i < $packetLength; $i++)
163165
{
164166
$error_msg .= $packet[$i];
165167
}

src/MySQLReplication/BinLog/BinLogServerInfo.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
namespace MySQLReplication\BinLog;
44

55
/**
6-
* Class ServerInfo
7-
* @package MySQLReplication\Pack
6+
* Class BinLogServerInfo
7+
* @package MySQLReplication\BinLog
88
*/
99
class BinLogServerInfo
1010
{
@@ -50,31 +50,31 @@ public static function parsePackage($pack)
5050
{
5151
self::$serverInfo['salt'] .= $pack[$j];
5252
}
53-
$i = $i + 8;
53+
$i += 8;
5454

5555
//filler_1 (1) -- 0x00
5656
$i++;
5757

5858
//capability_flag_1 (2) -- lower 2 bytes of the Protocol::CapabilityFlags (optional)
59-
$i = $i + 2;
59+
$i += 2;
6060

6161
//character_set (1) -- default server character-set, only the lower 8-bits Protocol::CharacterSet (optional)
6262
self::$serverInfo['character_set'] = $pack[$i];
6363
$i++;
6464

6565
//status_flags (2) -- Protocol::StatusFlags (optional)
66-
$i = $i + 2;
66+
$i += 2;
6767

6868
//capability_flags_2 (2) -- upper 2 bytes of the Protocol::CapabilityFlags
69-
$i = $i + 2;
69+
$i += 2;
7070

7171
//auth_plugin_data_len (1) -- length of the combined auth_plugin_data, if auth_plugin_data_len is > 0
7272
$salt_len = ord($pack[$i]);
7373
$i++;
7474

7575
$salt_len = max(12, $salt_len - 9);
7676

77-
$i = $i + 10;
77+
$i += 10;
7878

7979
//next salt
8080
if ($length >= $i + $salt_len)

src/MySQLReplication/BinLog/Exception/BinLogException.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44

55
use MySQLReplication\Exception\MySQLReplicationException;
66

7+
/**
8+
* Class BinLogException
9+
* @package MySQLReplication\BinLog\Exception
10+
*/
711
class BinLogException extends MySQLReplicationException
812
{
913
}

src/MySQLReplication/BinaryDataReader/BinaryDataReaderBuilder.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
namespace MySQLReplication\BinaryDataReader;
44

5+
/**
6+
* Class BinaryDataReaderBuilder
7+
* @package MySQLReplication\BinaryDataReader
8+
*/
59
class BinaryDataReaderBuilder
610
{
711
private $binaryData = '';

src/MySQLReplication/BinaryDataReader/BinaryDataReaderService.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
namespace MySQLReplication\BinaryDataReader;
44

55
/**
6-
* Class PackageService
6+
* Class BinaryDataReaderService
77
* @package MySQLReplication\BinaryDataReader
88
*/
99
class BinaryDataReaderService
1010
{
1111
/**
12-
* @param string $binaryData
12+
* @param $binaryData
1313
* @return BinaryDataReader
1414
*/
1515
public function makePackageFromBinaryData($binaryData)

src/MySQLReplication/BinaryDataReader/Exception/BinaryDataReaderException.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44

55
use MySQLReplication\Exception\MySQLReplicationException;
66

7+
/**
8+
* Class BinaryDataReaderException
9+
* @package MySQLReplication\BinaryDataReader\Exception
10+
*/
711
class BinaryDataReaderException extends MySQLReplicationException
812
{
913
}

src/MySQLReplication/Config/ConfigBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace MySQLReplication\Config;
44

55
/**
6-
* Class Config
6+
* Class ConfigBuilder
77
* @package MySQLReplication\Config
88
*/
99
class ConfigBuilder

src/MySQLReplication/Config/ConfigService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace MySQLReplication\Config;
44

55
/**
6-
* Class ConfigFactory
6+
* Class ConfigService
77
* @package MySQLReplication\Config
88
*/
99
class ConfigService

src/MySQLReplication/Config/Exception/ConfigException.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44

55
use MySQLReplication\Exception\MySQLReplicationException;
66

7+
/**
8+
* Class ConfigException
9+
* @package MySQLReplication\Config\Exception
10+
*/
711
class ConfigException extends MySQLReplicationException
812
{
913
const USER_ERROR_MESSAGE = 'Incorrect user given';

0 commit comments

Comments
 (0)