Skip to content

Commit

Permalink
Fix phpdoc Command classes and SchemaCache::class. (#565)
Browse files Browse the repository at this point in the history
  • Loading branch information
terabytesoftw committed Mar 3, 2023
1 parent b39a502 commit 868386c
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 25 deletions.
13 changes: 7 additions & 6 deletions src/Cache/SchemaCache.php
Expand Up @@ -19,14 +19,15 @@
use function strpbrk;

/**
* The SchemaCache class is used to cache database schema information.
* Implements a cache for the database schema information.
*
* The Schema class retrieves information about the database schema from the database server and stores it in the cache
* for faster access. When the Schema class needs to retrieve information about the database schema, it first checks the
* cache using the SchemaCache class. If the information is not in the cache, the Schema class retrieves it from the
* database server and stores it in the cache using the SchemaCache class.
* The {@see \Yiisoft\Db\Schema\AbstractSchema} retrieves information about the database schema from the database server
* and stores it in the cache for faster access. When the {@see \Yiisoft\Db\Schema\AbstractSchema} needs to retrieve
* information about the database schema, it first checks the cache using the {@see SchemaCache}. If the information is
* not in the cache, the Schema retrieves it from the database server and stores it in the cache using the
* {@see SchemaCache}.
*
* SchemaCache is used by {@see \Yiisoft\Db\Schema\Schema} to cache table metadata.
* This implementation is used by {@see \Yiisoft\Db\Schema\AbstractSchema} to cache table metadata.
*/
final class SchemaCache
{
Expand Down
15 changes: 7 additions & 8 deletions src/Command/AbstractCommand.php
Expand Up @@ -8,13 +8,11 @@
use Psr\Log\LoggerAwareTrait;
use Psr\Log\LogLevel;
use Throwable;
use Yiisoft\Db\Connection\ConnectionInterface;
use Yiisoft\Db\Exception\Exception;
use Yiisoft\Db\Expression\Expression;
use Yiisoft\Db\Profiler\ProfilerAwareTrait;
use Yiisoft\Db\Query\Data\DataReaderInterface;
use Yiisoft\Db\Query\QueryInterface;
use Yiisoft\Db\Transaction\TransactionInterface;

use function current;
use function explode;
Expand All @@ -31,9 +29,9 @@
use function strncmp;

/**
* Command represents a SQL statement to be executed against a database.
* Represents a SQL statement to be executed against a database.
*
* A command object is usually created by calling {@see ConnectionInterface::createCommand()}.
* A command object is usually created by calling {@see \Yiisoft\Db\Connection\ConnectionInterface::createCommand()}.
*
* The SQL statement it represents can be set via the {@see sql} property.
*
Expand All @@ -48,15 +46,16 @@
* $users = $connectionInterface->createCommand('SELECT * FROM user')->queryAll();
* ```
*
* Command supports SQL statement preparation and parameter binding.
* Abstract command supports SQL statement preparation and parameter binding.
*
* Call {@see bindValue()} to bind a value to a SQL parameter;
* Call {@see bindParam()} to bind a PHP variable to a SQL parameter.
*
* When binding a parameter, the SQL statement is automatically prepared. You may also call {@see prepare()} explicitly
* to prepare a SQL statement.
*
* Command also supports building SQL statements by providing methods such as {@see insert()}, {@see update()}, etc.
* Abstract command also supports building SQL statements by providing methods such as {@see insert()}, {@see update()},
* etc.
*
* For example, the following code will create and execute an INSERT SQL statement:
*
Expand All @@ -67,7 +66,7 @@
* )->execute();
* ```
*
* To build SELECT SQL statements, please use {@see QueryInterface} instead.
* To build SELECT SQL statements, please use {@see \Yiisoft\Db\Query\QueryInterface} instead.
*/
abstract class AbstractCommand implements CommandInterface
{
Expand Down Expand Up @@ -585,7 +584,7 @@ protected function requireTableSchemaRefresh(string $name): static
*
* @param string|null $isolationLevel The isolation level to use for this transaction.
*
* {@see TransactionInterface::begin()} for details.
* {@see \Yiisoft\Db\Transaction\TransactionInterface::begin()} for details.
*/
protected function requireTransaction(string $isolationLevel = null): static
{
Expand Down
5 changes: 2 additions & 3 deletions src/Command/CommandInterface.php
Expand Up @@ -19,10 +19,9 @@
use Yiisoft\Db\QueryBuilder\QueryBuilderInterface;

/**
* The CommandInterface is an interface represents a database command, such as a SELECT, INSERT, UPDATE, or DELETE
* statement.
* This interface represents a database command, such as a SELECT, INSERT, UPDATE, or DELETE statement.
*
* A Command object is usually created by calling {@see ConnectionInterface::createCommand()}.
* A command object is usually created by calling {@see \Yiisoft\Db\Connection\ConnectionInterface::createCommand()}.
*/
interface CommandInterface
{
Expand Down
10 changes: 5 additions & 5 deletions src/Command/Param.php
Expand Up @@ -7,11 +7,11 @@
use Yiisoft\Db\Expression\ExpressionInterface;

/**
* The Param class represents a parameter used in building a SQL statement. It can be used to represent a placeholder
* in a SQL statement, and can be bound to a specific value when the statement is executed. It can also represent a
* column name or table name, depending on the context in which it is used. The class provides methods for specifying
* the parameter name, value, as well as methods for quoting and escaping the parameter value to ensure that it is
* properly handled by the database.
* Represents a parameter used in building a SQL statement. It can be used to represent a placeholder in a SQL
* statement, and can be bound to a specific value when the statement is executed. It can also represent a column name
* or table name, depending on the context in which it is used. The class provides methods for specifying the parameter
* name, value, as well as methods for quoting and escaping the parameter value to ensure that it is properly handled by
* the database.
*/
final class Param implements ParamInterface, ExpressionInterface
{
Expand Down
3 changes: 1 addition & 2 deletions src/Command/ParamBuilder.php
Expand Up @@ -10,8 +10,7 @@
use function count;

/**
* The ParamBuilder class, which implements the {@see ExpressionBuilderInterface} interface, is used to build
* {@see ParamInterface} objects.
* Implements the {@see ExpressionBuilderInterface} interface, is used to build {@see ParamInterface} objects.
*/
final class ParamBuilder implements ExpressionBuilderInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/Command/ParamInterface.php
Expand Up @@ -5,7 +5,7 @@
namespace Yiisoft\Db\Command;

/**
* The ParamInterface is an interface represents a parameter to be bound to a SQL statement.
* This interface represents a parameter to be bound to a SQL statement.
*/
interface ParamInterface
{
Expand Down

0 comments on commit 868386c

Please sign in to comment.