diff --git a/CHANGELOG.md b/CHANGELOG.md index 7264bbb..123bfcb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -130,7 +130,7 @@ using the new lazy connections as detailed below. From a consumer side this means that you can start sending queries to the database right away while the underlying connection may still be outstanding. Because creating this underlying connection may take some - time, it will enqueue all oustanding commands and will ensure that all + time, it will enqueue all outstanding commands and will ensure that all commands will be executed in correct order once the connection is ready. In other words, this "virtual" connection behaves just like a "real" connection as described in the `ConnectionInterface` and frees you from @@ -176,7 +176,7 @@ have to take care of when updating from an older version. $connection = new Connection($loop, $options); $connection->connect(function (?Exception $error, $connection) { if ($error) { - // an error occured while trying to connect or authorize client + // an error occurred while trying to connect or authorize client } else { // client connection established (and authenticated) } @@ -189,7 +189,7 @@ have to take care of when updating from an older version. // client connection established (and authenticated) }, function (Exception $e) { - // an error occured while trying to connect or authorize client + // an error occurred while trying to connect or authorize client } ); ``` diff --git a/README.md b/README.md index 80d27a4..97cc083 100644 --- a/README.md +++ b/README.md @@ -111,7 +111,7 @@ $factory->createConnection($url)->then( // client connection established (and authenticated) }, function (Exception $e) { - // an error occured while trying to connect or authorize client + // an error occurred while trying to connect or authorize client } ); ``` @@ -213,7 +213,7 @@ underlying connection if this idle time is expired. From a consumer side this means that you can start sending queries to the database right away while the underlying connection may still be outstanding. Because creating this underlying connection may take some -time, it will enqueue all oustanding commands and will ensure that all +time, it will enqueue all outstanding commands and will ensure that all commands will be executed in correct order once the connection is ready. In other words, this "virtual" connection behaves just like a "real" connection as described in the `ConnectionInterface` and frees you from @@ -463,7 +463,7 @@ The `close(): void` method can be used to force-close the connection. Unlike the `quit()` method, this method will immediately force-close the -connection and reject all oustanding commands. +connection and reject all outstanding commands. ```php $connection->close(); diff --git a/examples/12-slow-stream.php b/examples/12-slow-stream.php index 8d5faa4..bb1af49 100644 --- a/examples/12-slow-stream.php +++ b/examples/12-slow-stream.php @@ -18,7 +18,7 @@ $factory->createConnection($uri)->then(function (ConnectionInterface $connection) use ($query) { // The protocol parser reads rather large chunked from the underlying connection // and as such can yield multiple (dozens to hundreds) rows from a single data - // chunk. We try to artifically limit the stream chunk size here to try to + // chunk. We try to artificially limit the stream chunk size here to try to // only ever read a single row so we can demonstrate throttling this stream. // It goes without saying this is only a hack! Real world applications rarely // have the need to limit the chunk size. As an alternative, consider using diff --git a/src/ConnectionInterface.php b/src/ConnectionInterface.php index db94b47..e379dbc 100644 --- a/src/ConnectionInterface.php +++ b/src/ConnectionInterface.php @@ -209,7 +209,7 @@ public function quit(); * Force-close the connection. * * Unlike the `quit()` method, this method will immediately force-close the - * connection and reject all oustanding commands. + * connection and reject all outstanding commands. * * ```php * $connection->close(); diff --git a/src/Factory.php b/src/Factory.php index 9d55800..25911e7 100644 --- a/src/Factory.php +++ b/src/Factory.php @@ -77,7 +77,7 @@ public function __construct(LoopInterface $loop = null, ConnectorInterface $conn * // client connection established (and authenticated) * }, * function (Exception $e) { - * // an error occured while trying to connect or authorize client + * // an error occurred while trying to connect or authorize client * } * ); * ``` @@ -286,7 +286,7 @@ public function createConnection( * From a consumer side this means that you can start sending queries to the * database right away while the underlying connection may still be * outstanding. Because creating this underlying connection may take some - * time, it will enqueue all oustanding commands and will ensure that all + * time, it will enqueue all outstanding commands and will ensure that all * commands will be executed in correct order once the connection is ready. * In other words, this "virtual" connection behaves just like a "real" * connection as described in the `ConnectionInterface` and frees you from diff --git a/src/Io/Buffer.php b/src/Io/Buffer.php index 4eac8c4..36bd87e 100644 --- a/src/Io/Buffer.php +++ b/src/Io/Buffer.php @@ -104,7 +104,7 @@ public function readBuffer($len) * This method can be used instead of `read()` if you do not care about the * bytes that will be skipped. * - * @param int $len length in bytes, must be positve and non-zero + * @param int $len length in bytes, must be positive and non-zero * @return void * @throws \UnderflowException */ diff --git a/src/Io/Connection.php b/src/Io/Connection.php index c04d565..73313ba 100644 --- a/src/Io/Connection.php +++ b/src/Io/Connection.php @@ -21,7 +21,7 @@ class Connection extends EventEmitter implements ConnectionInterface { const STATE_AUTHENTICATED = 5; - const STATE_CLOSEING = 6; + const STATE_CLOSING = 6; const STATE_CLOSED = 7; /** @@ -146,7 +146,7 @@ public function quit() $this->emit('close', [$this]); $resolve(null); }); - $this->state = self::STATE_CLOSEING; + $this->state = self::STATE_CLOSING; }); } @@ -199,7 +199,7 @@ public function handleConnectionError($err) */ public function handleConnectionClosed() { - if ($this->state < self::STATE_CLOSEING) { + if ($this->state < self::STATE_CLOSING) { $this->emit('error', [new \RuntimeException( 'Connection closed by peer (ECONNRESET)', \defined('SOCKET_ECONNRESET') ? \SOCKET_ECONNRESET : 104 diff --git a/src/Io/Parser.php b/src/Io/Parser.php index 2d6613e..0e8643f 100644 --- a/src/Io/Parser.php +++ b/src/Io/Parser.php @@ -89,7 +89,7 @@ class Parser protected $insertId; protected $affectedRows; - public $protocalVersion = 0; + public $protocolVersion = 0; private $buffer; @@ -199,8 +199,8 @@ private function parsePacket(Buffer $packet) } $this->phase = self::PHASE_GOT_INIT; - $this->protocalVersion = $response; - $this->debug(sprintf("Protocal Version: %d", $this->protocalVersion)); + $this->protocolVersion = $response; + $this->debug(sprintf("Protocol Version: %d", $this->protocolVersion)); $options = &$this->connectOptions; $options['serverVersion'] = $packet->readStringNull(); diff --git a/src/Io/Query.php b/src/Io/Query.php index 71ab90d..76a4687 100644 --- a/src/Io/Query.php +++ b/src/Io/Query.php @@ -47,7 +47,7 @@ public function __construct($sql) } /** - * Binding params for the query, mutiple arguments support. + * Binding params for the query, multiple arguments support. * * @param mixed $param * @return self @@ -69,7 +69,7 @@ public function bindParamsFromArray(array $params) } /** - * Binding params for the query, mutiple arguments support. + * Binding params for the query, multiple arguments support. * * @param mixed $param * @return self @@ -116,7 +116,7 @@ protected function resolveValueForSql($value) $value = 'NULL'; break; default: - throw new \InvalidArgumentException(sprintf('Not supportted value type of %s.', $type)); + throw new \InvalidArgumentException(sprintf('Not supported value type of %s.', $type)); break; } diff --git a/tests/ResultQueryTest.php b/tests/ResultQueryTest.php index f0f4eb4..e38fe71 100644 --- a/tests/ResultQueryTest.php +++ b/tests/ResultQueryTest.php @@ -366,7 +366,7 @@ public function testSelectCharsetDefaultsToUtf8() Loop::run(); } - public function testSelectWithExplcitCharsetReturnsCharset() + public function testSelectWithExplicitCharsetReturnsCharset() { $factory = new Factory();