Skip to content

Commit

Permalink
Merge pull request #184 from yadaiio/typos
Browse files Browse the repository at this point in the history
Fix typos in documentation
  • Loading branch information
WyriHaximus authored Nov 9, 2023
2 parents 800e32e + 69629c9 commit afa35f4
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 21 deletions.
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
}
Expand All @@ -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
}
);
```
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
);
```
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion examples/12-slow-stream.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/ConnectionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions src/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
* }
* );
* ```
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/Io/Buffer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
6 changes: 3 additions & 3 deletions src/Io/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down Expand Up @@ -146,7 +146,7 @@ public function quit()
$this->emit('close', [$this]);
$resolve(null);
});
$this->state = self::STATE_CLOSEING;
$this->state = self::STATE_CLOSING;
});
}

Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/Io/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class Parser
protected $insertId;
protected $affectedRows;

public $protocalVersion = 0;
public $protocolVersion = 0;

private $buffer;

Expand Down Expand Up @@ -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();
Expand Down
6 changes: 3 additions & 3 deletions src/Io/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion tests/ResultQueryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ public function testSelectCharsetDefaultsToUtf8()
Loop::run();
}

public function testSelectWithExplcitCharsetReturnsCharset()
public function testSelectWithExplicitCharsetReturnsCharset()
{
$factory = new Factory();

Expand Down

0 comments on commit afa35f4

Please sign in to comment.