@@ -43,14 +43,14 @@ |
||
43 | 43 | if (($value & $mask) || $buffer !== '') { |
44 | 44 | // Get the current byte by shifting it to least significant position and add it to the string |
45 | 45 | // 0xFF12345678 => 0xFF |
46 | - $byte = $value >> (8 * $i); |
|
46 | + $byte = $value >> (8 * $i); |
|
47 | 47 | $buffer .= chr($byte); |
48 | 48 | |
49 | 49 | // Set the most significant byte to 0 so we can restart the process being shure |
50 | 50 | // that the value is left padded with 0 |
51 | 51 | // 0xFF12345678 => 0x12345678 |
52 | 52 | // -1 = 0xFFFFF.... (number of F depend of PHP_INT_SIZE ) |
53 | - $mask = -1 >> ((PHP_INT_SIZE - $i) * 8); |
|
53 | + $mask = -1 >> ((PHP_INT_SIZE - $i) * 8); |
|
54 | 54 | $value &= $mask; |
55 | 55 | } |
56 | 56 | } |
@@ -46,9 +46,9 @@ |
||
46 | 46 | * List of available operators for "->where()" method |
47 | 47 | */ |
48 | 48 | public const AVAILABLE_OPERATORS = [ |
49 | - '-', // Does not have |
|
50 | - '=', // Equal |
|
51 | - '>', // More than |
|
49 | + '-', // Does not have |
|
50 | + '=', // Equal |
|
51 | + '>', // More than |
|
52 | 52 | '<' // Less than |
53 | 53 | ]; |
54 | 54 |
@@ -51,7 +51,7 @@ |
||
51 | 51 | $result = fread($this->stream, $length); |
52 | 52 | |
53 | 53 | // Stream in blocking mode timed out |
54 | - if(socket_get_status($this->stream)['timed_out']){ |
|
54 | + if (socket_get_status($this->stream)['timed_out']) { |
|
55 | 55 | throw new StreamException('Stream timed out'); |
56 | 56 | } |
57 | 57 |
@@ -15,9 +15,9 @@ discard block |
||
15 | 15 | */ |
16 | 16 | |
17 | 17 | 'host' => '192.168.88.1', // Address of Mikrotik RouterOS |
18 | - 'user' => 'admin', // Username |
|
19 | - 'pass' => null, // Password |
|
20 | - 'port' => 8728, // RouterOS API port number for access (if not set use default or default with SSL if SSL enabled) |
|
18 | + 'user' => 'admin', // Username |
|
19 | + 'pass' => null, // Password |
|
20 | + 'port' => 8728, // RouterOS API port number for access (if not set use default or default with SSL if SSL enabled) |
|
21 | 21 | |
22 | 22 | /* |
23 | 23 | |-------------------------------------------------------------------------- |
@@ -30,10 +30,10 @@ discard block |
||
30 | 30 | | |
31 | 31 | */ |
32 | 32 | |
33 | - 'attempts' => 10, // Count of attempts to establish TCP session |
|
34 | - 'delay' => 1, // Delay between attempts in seconds |
|
35 | - 'timeout' => 10, // Max timeout for instantiating connection with RouterOS |
|
36 | - 'socket_timeout' => 30, // Max timeout for read from RouterOS |
|
33 | + 'attempts' => 10, // Count of attempts to establish TCP session |
|
34 | + 'delay' => 1, // Delay between attempts in seconds |
|
35 | + 'timeout' => 10, // Max timeout for instantiating connection with RouterOS |
|
36 | + 'socket_timeout' => 30, // Max timeout for read from RouterOS |
|
37 | 37 | 'socket_blocking' => true, // Set blocking mode on a socket stream |
38 | 38 | |
39 | 39 | // @see https://www.php.net/manual/en/context.socket.php |
@@ -66,9 +66,9 @@ discard block |
||
66 | 66 | // @see https://www.php.net/manual/en/context.ssl.php |
67 | 67 | 'ssl_options' => [ |
68 | 68 | 'ciphers' => 'ADH:ALL', // ADH:ALL, ADH:ALL@SECLEVEL=0, ADH:ALL@SECLEVEL=1 ... ADH:ALL@SECLEVEL=5 |
69 | - 'verify_peer' => false, // Require verification of SSL certificate used. |
|
70 | - 'verify_peer_name' => false, // Require verification of peer name. |
|
71 | - 'allow_self_signed' => false, // Allow self-signed certificates. Requires verify_peer=true. |
|
69 | + 'verify_peer' => false, // Require verification of SSL certificate used. |
|
70 | + 'verify_peer_name' => false, // Require verification of peer name. |
|
71 | + 'allow_self_signed' => false, // Allow self-signed certificates. Requires verify_peer=true. |
|
72 | 72 | ], |
73 | 73 | |
74 | 74 | /* |
@@ -59,7 +59,7 @@ |
||
59 | 59 | } |
60 | 60 | |
61 | 61 | // Set blocking mode on a stream |
62 | - if ($this->config('socket_blocking') === true){ |
|
62 | + if ($this->config('socket_blocking') === true) { |
|
63 | 63 | stream_set_blocking($socketClient, true); |
64 | 64 | } |
65 | 65 |
@@ -126,22 +126,22 @@ |
||
126 | 126 | * List of allowed parameters of config |
127 | 127 | */ |
128 | 128 | public const ALLOWED = [ |
129 | - 'host' => 'string', // Address of Mikrotik RouterOS |
|
130 | - 'user' => 'string', // Username |
|
131 | - 'pass' => 'string', // Password |
|
129 | + 'host' => 'string', // Address of Mikrotik RouterOS |
|
130 | + 'user' => 'string', // Username |
|
131 | + 'pass' => 'string', // Password |
|
132 | 132 | 'port' => 'integer', // RouterOS API port number for access (if not set use default or default with SSL if SSL enabled) |
133 | 133 | 'ssl' => 'boolean', // Enable ssl support (if port is not set this parameter must change default port to ssl port) |
134 | - 'ssl_options' => 'array', // List of SSL options, eg. |
|
134 | + 'ssl_options' => 'array', // List of SSL options, eg. |
|
135 | 135 | 'legacy' => 'boolean', // Support of legacy login scheme (true - pre 6.43, false - post 6.43) |
136 | 136 | 'timeout' => 'integer', // Max timeout for instantiating connection with RouterOS |
137 | 137 | 'socket_timeout' => 'integer', // Max timeout for read from RouterOS |
138 | 138 | 'socket_blocking' => 'boolean', // Set blocking mode on a socket stream |
139 | - 'socket_options' => 'array', // List of socket context options |
|
139 | + 'socket_options' => 'array', // List of socket context options |
|
140 | 140 | 'attempts' => 'integer', // Count of attempts to establish TCP session |
141 | 141 | 'delay' => 'integer', // Delay between attempts in seconds |
142 | 142 | 'ssh_port' => 'integer', // Number of SSH port |
143 | 143 | 'ssh_timeout' => 'integer', // Max timeout for read from RouterOS via SSH proto (for "/export" command) |
144 | - 'ssh_private_key' => 'string', // Max timeout for read from RouterOS via SSH proto (for "/export" command) |
|
144 | + 'ssh_private_key' => 'string', // Max timeout for read from RouterOS via SSH proto (for "/export" command) |
|
145 | 145 | ]; |
146 | 146 | |
147 | 147 | /** |