Skip to content

Commit

Permalink
Fix phpdoc Connection classes. (#567)
Browse files Browse the repository at this point in the history
  • Loading branch information
terabytesoftw committed Mar 5, 2023
1 parent 3fba50c commit c2192b5
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 14 deletions.
6 changes: 4 additions & 2 deletions src/Connection/AbstractConnection.php
Expand Up @@ -18,8 +18,8 @@
use Yiisoft\Db\Transaction\TransactionInterface;

/**
* The AbstractConnection class represents a connection to a database. It provides methods for interacting with the
* database, such as executing SQL queries and performing data manipulation.
* Represents a connection to a database. It provides methods for interacting with the database, such as executing SQL
* queries and performing data manipulation.
*/
abstract class AbstractConnection implements ConnectionInterface, LoggerAwareInterface
{
Expand Down Expand Up @@ -112,6 +112,8 @@ public function transaction(Closure $closure, string $isolationLevel = null): mi
*
* @param TransactionInterface $transaction TransactionInterface object given from {@see beginTransaction()}.
* @param int $level TransactionInterface level just after {@see beginTransaction()} call.
*
* @throws Throwable If transaction was not rolled back.
*/
private function rollbackTransactionOnLevel(TransactionInterface $transaction, int $level): void
{
Expand Down
4 changes: 2 additions & 2 deletions src/Connection/AbstractDsn.php
Expand Up @@ -9,8 +9,8 @@
use function implode;

/**
* The Dsn class is typically used to parse a DSN string, which is a string that contains all the necessary information
* to connect to a database, such as the database driver, hostname, database name, port and options.
* it's typically used to parse a DSN string, which is a string that contains all the necessary information to connect
* to a database, such as the database driver, hostname, database name, port and options.
*
* It also allows you to access individual components of the DSN, such as the driver or the database name.
*/
Expand Down
4 changes: 2 additions & 2 deletions src/Connection/AbstractDsnSocket.php
Expand Up @@ -9,8 +9,8 @@
use function implode;

/**
* The Dsn class is typically used to parse a DSN string, which is a string that contains all the necessary information
* to connect to a database, such as the database driver, unix socket, database name, options.
* It's typically used to parse a DSN string, which is a string that contains all the necessary information to connect
* to a database, such as the database driver, unix socket, database name, options.
*
* It also allows you to access individual components of the DSN, such as the driver or the database name.
*/
Expand Down
8 changes: 3 additions & 5 deletions src/Connection/ConnectionInterface.php
Expand Up @@ -20,11 +20,9 @@
use Yiisoft\Db\Schema\TableSchemaInterface;
use Yiisoft\Db\Transaction\TransactionInterface;

use function version_compare;

/**
* The ConnectionInterface provides methods for establishing a connection to a database, executing SQL statements, and
* performing other tasks related to interacting with a database.
* This interface provides methods for establishing a connection to a database, executing SQL statements, and performing
* other tasks related to interacting with a database.
*
* It allows you to access and manipulate databases in a database-agnostic way, so you can write code that works with
* different database systems without having to worry about the specific details of each one.
Expand Down Expand Up @@ -138,7 +136,7 @@ public function getQuoter(): QuoterInterface;
public function getSchema(): SchemaInterface;

/**
* Returns a server version as a string comparable by {@see version_compare()}.
* Returns a server version as a string comparable by {@see \version_compare()}.
*
* @return string The server version as a string.
*/
Expand Down
8 changes: 6 additions & 2 deletions src/Connection/ConnectionPoolInterface.php
Expand Up @@ -7,6 +7,10 @@
use Closure;
use Throwable;

/**
* This interface represents a connection pool. It provides a way to get a connection from the pool. It also provides
* methods to set and get the master and slave connections.
*/
interface ConnectionPoolInterface
{
/**
Expand Down Expand Up @@ -89,8 +93,8 @@ public function setSlave(string $key, ConnectionInterface $slave): void;
* });
* ```
*
* @param Closure $callback a PHP Closure to be executed by this method. Its signature is
* `function (ConnectionInterface $db)`. Its return value will be returned by this method.
* @param Closure $closure a PHP Closure to be executed by this method.
* Its signature is `function (ConnectionInterface $db)`. Its return value will be returned by this method.
*
* @throws Throwable If there is any exception thrown from the callback.
*
Expand Down
2 changes: 1 addition & 1 deletion src/Connection/DsnInterface.php
Expand Up @@ -5,7 +5,7 @@
namespace Yiisoft\Db\Connection;

/**
* DsnInterface represents a Data Source Name. It is used to configure a {@see ConnectionInterface} instance. The DSN
* This interface represents a Data Source Name. It is used to configure a {@see ConnectionInterface} instance. The DSN
* string format is described in {@see asString()}.
*/
interface DsnInterface
Expand Down

0 comments on commit c2192b5

Please sign in to comment.