Skip to content

Commit

Permalink
Move DataType class to Yiisoft\Db\Constant namespace (#921)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tigrov authored Jan 13, 2025
1 parent 30aca10 commit 03a0367
Show file tree
Hide file tree
Showing 17 changed files with 18 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
- Enh #915: Remove `ColumnInterface` (@Tigrov)
- Enh #917: Rename `ColumnSchemaInterface` to `ColumnInterface` (@Tigrov)
- Enh #919: Replace `name()` with immutable `withName()` method in `ColumnInterface` interface (@Tigrov)
- Enh #921: Move `DataType` class to `Yiisoft\Db\Constant` namespace (@Tigrov)

## 1.3.0 March 21, 2024

Expand Down
1 change: 1 addition & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,3 +163,4 @@ Each table column has its own class in the `Yiisoft\Db\Schema\Column` namespace
- Allow `QueryInterface::one()` to return an object;
- Allow `QueryInterface::all()` to return array of objects;
- Change `Quoter::quoteValue()` parameter type and return type from `mixed` to `string`;
- Move `DataType` class to `Yiisoft\Db\Constant` namespace;
2 changes: 1 addition & 1 deletion docs/guide/en/queries/transactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ In order for the data to be consistent when multiple commands are involved, you
```php
use Yiisoft\Db\Connection\ConnectionInterface;
use Yiisoft\Db\Query\Query;
use Yiisoft\Db\Command\DataType;
use Yiisoft\Db\Constant\DataType;

/** @var ConnectionInterface $db */

Expand Down
2 changes: 1 addition & 1 deletion docs/guide/pt-BR/queries/transactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Para que os dados sejam consistentes quando vários comandos estiverem envolvido
```php
use Yiisoft\Db\Connection\ConnectionInterface;
use Yiisoft\Db\Query\Query;
use Yiisoft\Db\Command\DataType;
use Yiisoft\Db\Constant\DataType;

/** @var ConnectionInterface $db */

Expand Down
1 change: 1 addition & 0 deletions src/Command/CommandInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Throwable;
use Yiisoft\Db\Connection\ConnectionInterface;
use Yiisoft\Db\Constant\ColumnType;
use Yiisoft\Db\Constant\DataType;
use Yiisoft\Db\Constant\PseudoType;
use Yiisoft\Db\Exception\Exception;
use Yiisoft\Db\Exception\InvalidArgumentException;
Expand Down
1 change: 1 addition & 0 deletions src/Command/Param.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Yiisoft\Db\Command;

use Yiisoft\Db\Constant\DataType;
use Yiisoft\Db\Expression\ExpressionInterface;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Command/ParamInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

namespace Yiisoft\Db\Command;

use Yiisoft\Db\Constant\DataType;

/**
* This interface represents a parameter to bind to an SQL statement.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Command/DataType.php → src/Constant/DataType.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Yiisoft\Db\Command;
namespace Yiisoft\Db\Constant;

/**
* Types of data.
Expand Down
2 changes: 1 addition & 1 deletion src/QueryBuilder/AbstractQueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace Yiisoft\Db\QueryBuilder;

use Yiisoft\Db\Command\CommandInterface;
use Yiisoft\Db\Command\DataType;
use Yiisoft\Db\Constant\DataType;
use Yiisoft\Db\Command\ParamInterface;
use Yiisoft\Db\Connection\ConnectionInterface;
use Yiisoft\Db\Connection\ServerInfoInterface;
Expand Down
2 changes: 1 addition & 1 deletion src/Schema/AbstractSchema.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Psr\SimpleCache\InvalidArgumentException;
use Throwable;
use Yiisoft\Db\Cache\SchemaCache;
use Yiisoft\Db\Command\DataType;
use Yiisoft\Db\Constant\DataType;
use Yiisoft\Db\Connection\ConnectionInterface;
use Yiisoft\Db\Constraint\Constraint;
use Yiisoft\Db\Constraint\IndexConstraint;
Expand Down
2 changes: 1 addition & 1 deletion src/Schema/SchemaInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace Yiisoft\Db\Schema;

use Throwable;
use Yiisoft\Db\Command\DataType;
use Yiisoft\Db\Constant\DataType;
use Yiisoft\Db\Constant\ColumnType;
use Yiisoft\Db\Constant\PseudoType;
use Yiisoft\Db\Constraint\ConstraintSchemaInterface;
Expand Down
2 changes: 1 addition & 1 deletion tests/AbstractQueryBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use PHPUnit\Framework\TestCase;
use stdClass;
use Throwable;
use Yiisoft\Db\Command\DataType;
use Yiisoft\Db\Constant\DataType;
use Yiisoft\Db\Command\Param;
use Yiisoft\Db\Exception\Exception;
use Yiisoft\Db\Exception\InvalidArgumentException;
Expand Down
2 changes: 1 addition & 1 deletion tests/AbstractSchemaTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace Yiisoft\Db\Tests;

use PHPUnit\Framework\TestCase;
use Yiisoft\Db\Command\DataType;
use Yiisoft\Db\Constant\DataType;
use Yiisoft\Db\Tests\Support\Assert;
use Yiisoft\Db\Tests\Support\TestTrait;

Expand Down
2 changes: 1 addition & 1 deletion tests/Common/CommonCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use ReflectionException;
use Throwable;
use Yiisoft\Db\Command\DataType;
use Yiisoft\Db\Constant\DataType;
use Yiisoft\Db\Command\Param;
use Yiisoft\Db\Constant\ColumnType;
use Yiisoft\Db\Constant\PseudoType;
Expand Down
2 changes: 1 addition & 1 deletion tests/Provider/CommandPDOProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Yiisoft\Db\Tests\Provider;

use Yiisoft\Db\Command\DataType;
use Yiisoft\Db\Constant\DataType;

class CommandPDOProvider
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Provider/CommandProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use ArrayIterator;
use IteratorAggregate;
use Traversable;
use Yiisoft\Db\Command\DataType;
use Yiisoft\Db\Constant\DataType;
use Yiisoft\Db\Command\Param;
use Yiisoft\Db\Constant\ColumnType;
use Yiisoft\Db\Expression\Expression;
Expand Down
2 changes: 1 addition & 1 deletion tests/Provider/QueryBuilderProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace Yiisoft\Db\Tests\Provider;

use ArrayIterator;
use Yiisoft\Db\Command\DataType;
use Yiisoft\Db\Constant\DataType;
use Yiisoft\Db\Command\Param;
use Yiisoft\Db\Constant\ColumnType;
use Yiisoft\Db\Constant\PseudoType;
Expand Down

0 comments on commit 03a0367

Please sign in to comment.