Extract constants for built-in types from Type to DefaultTypes

parent 11b67bbd
# Upgrade to 2.10
## Deprecated `Type::*` constants
The constants for built-in types have been moved from `Doctrine\DBAL\Types\Type` to a separate class `Doctrine\DBAL\Types\Types`.
Some of the constants were renamed in the process:
* `TARRAY`-> `ARRAY`
* `DATE` -> `DATE_MUTABLE`
* `DATETIME` -> `DATETIME_MUTABLE`
* `DATETIMETZ` -> `DATETIMETZ_MUTABLE`
* `TIME` -> `TIME_MUTABLE`
# Upgrade to 2.9 # Upgrade to 2.9
## Deprecated `Statement::fetchColumn()` with an invalid index ## Deprecated `Statement::fetchColumn()` with an invalid index
......
...@@ -8,6 +8,7 @@ use Doctrine\DBAL\Schema\Identifier; ...@@ -8,6 +8,7 @@ use Doctrine\DBAL\Schema\Identifier;
use Doctrine\DBAL\Schema\Index; use Doctrine\DBAL\Schema\Index;
use Doctrine\DBAL\Schema\TableDiff; use Doctrine\DBAL\Schema\TableDiff;
use Doctrine\DBAL\Types\Type; use Doctrine\DBAL\Types\Type;
use Doctrine\DBAL\Types\Types;
use function array_merge; use function array_merge;
use function count; use function count;
use function current; use function current;
...@@ -96,7 +97,7 @@ class DB2Platform extends AbstractPlatform ...@@ -96,7 +97,7 @@ class DB2Platform extends AbstractPlatform
*/ */
public function isCommentedDoctrineType(Type $doctrineType) public function isCommentedDoctrineType(Type $doctrineType)
{ {
if ($doctrineType->getName() === Type::BOOLEAN) { if ($doctrineType->getName() === Types::BOOLEAN) {
// We require a commented boolean type in order to distinguish between boolean and smallint // We require a commented boolean type in order to distinguish between boolean and smallint
// as both (have to) map to the same native type. // as both (have to) map to the same native type.
return true; return true;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
namespace Doctrine\DBAL\Platforms; namespace Doctrine\DBAL\Platforms;
use Doctrine\DBAL\Types\Type; use Doctrine\DBAL\Types\Types;
/** /**
* Provides the behavior, features and SQL dialect of the MariaDB 10.2 (10.2.7 GA) database platform. * Provides the behavior, features and SQL dialect of the MariaDB 10.2 (10.2.7 GA) database platform.
...@@ -36,6 +36,6 @@ final class MariaDb1027Platform extends MySqlPlatform ...@@ -36,6 +36,6 @@ final class MariaDb1027Platform extends MySqlPlatform
{ {
parent::initializeDoctrineTypeMappings(); parent::initializeDoctrineTypeMappings();
$this->doctrineTypeMapping['json'] = Type::JSON; $this->doctrineTypeMapping['json'] = Types::JSON;
} }
} }
...@@ -4,7 +4,7 @@ namespace Doctrine\DBAL\Platforms; ...@@ -4,7 +4,7 @@ namespace Doctrine\DBAL\Platforms;
use Doctrine\DBAL\Schema\Index; use Doctrine\DBAL\Schema\Index;
use Doctrine\DBAL\Schema\TableDiff; use Doctrine\DBAL\Schema\TableDiff;
use Doctrine\DBAL\Types\Type; use Doctrine\DBAL\Types\Types;
/** /**
* Provides the behavior, features and SQL dialect of the MySQL 5.7 (5.7.9 GA) database platform. * Provides the behavior, features and SQL dialect of the MySQL 5.7 (5.7.9 GA) database platform.
...@@ -66,6 +66,6 @@ class MySQL57Platform extends MySqlPlatform ...@@ -66,6 +66,6 @@ class MySQL57Platform extends MySqlPlatform
{ {
parent::initializeDoctrineTypeMappings(); parent::initializeDoctrineTypeMappings();
$this->doctrineTypeMapping['json'] = Type::JSON; $this->doctrineTypeMapping['json'] = Types::JSON;
} }
} }
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
namespace Doctrine\DBAL\Platforms; namespace Doctrine\DBAL\Platforms;
use Doctrine\DBAL\Types\Type; use Doctrine\DBAL\Types\Types;
use function sprintf; use function sprintf;
/** /**
...@@ -53,7 +53,7 @@ class PostgreSQL92Platform extends PostgreSQL91Platform ...@@ -53,7 +53,7 @@ class PostgreSQL92Platform extends PostgreSQL91Platform
{ {
parent::initializeDoctrineTypeMappings(); parent::initializeDoctrineTypeMappings();
$this->doctrineTypeMapping['json'] = Type::JSON; $this->doctrineTypeMapping['json'] = Types::JSON;
} }
/** /**
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
namespace Doctrine\DBAL\Platforms; namespace Doctrine\DBAL\Platforms;
use Doctrine\DBAL\Types\Type; use Doctrine\DBAL\Types\Types;
/** /**
* Provides the behavior, features and SQL dialect of the PostgreSQL 9.4 database platform. * Provides the behavior, features and SQL dialect of the PostgreSQL 9.4 database platform.
...@@ -36,6 +36,6 @@ class PostgreSQL94Platform extends PostgreSQL92Platform ...@@ -36,6 +36,6 @@ class PostgreSQL94Platform extends PostgreSQL92Platform
{ {
parent::initializeDoctrineTypeMappings(); parent::initializeDoctrineTypeMappings();
$this->doctrineTypeMapping['jsonb'] = Type::JSON; $this->doctrineTypeMapping['jsonb'] = Types::JSON;
} }
} }
...@@ -6,6 +6,7 @@ use Doctrine\DBAL\Exception\DriverException; ...@@ -6,6 +6,7 @@ use Doctrine\DBAL\Exception\DriverException;
use Doctrine\DBAL\FetchMode; use Doctrine\DBAL\FetchMode;
use Doctrine\DBAL\Platforms\PostgreSqlPlatform; use Doctrine\DBAL\Platforms\PostgreSqlPlatform;
use Doctrine\DBAL\Types\Type; use Doctrine\DBAL\Types\Type;
use Doctrine\DBAL\Types\Types;
use const CASE_LOWER; use const CASE_LOWER;
use function array_change_key_case; use function array_change_key_case;
use function array_filter; use function array_filter;
...@@ -456,7 +457,7 @@ class PostgreSqlSchemaManager extends AbstractSchemaManager ...@@ -456,7 +457,7 @@ class PostgreSqlSchemaManager extends AbstractSchemaManager
$column->setPlatformOption('collation', $tableColumn['collation']); $column->setPlatformOption('collation', $tableColumn['collation']);
} }
if (in_array($column->getType()->getName(), [Type::JSON_ARRAY, Type::JSON], true)) { if (in_array($column->getType()->getName(), [Types::JSON_ARRAY, Types::JSON], true)) {
$column->setPlatformOption('jsonb', $jsonb); $column->setPlatformOption('jsonb', $jsonb);
} }
......
...@@ -9,6 +9,7 @@ use Doctrine\DBAL\Schema\Synchronizer\AbstractSchemaSynchronizer; ...@@ -9,6 +9,7 @@ use Doctrine\DBAL\Schema\Synchronizer\AbstractSchemaSynchronizer;
use Doctrine\DBAL\Schema\Synchronizer\SchemaSynchronizer; use Doctrine\DBAL\Schema\Synchronizer\SchemaSynchronizer;
use Doctrine\DBAL\Schema\Synchronizer\SingleDatabaseSynchronizer; use Doctrine\DBAL\Schema\Synchronizer\SingleDatabaseSynchronizer;
use Doctrine\DBAL\Types\Type; use Doctrine\DBAL\Types\Type;
use Doctrine\DBAL\Types\Types;
use RuntimeException; use RuntimeException;
use function array_merge; use function array_merge;
...@@ -240,12 +241,12 @@ class SQLAzureFederationsSynchronizer extends AbstractSchemaSynchronizer ...@@ -240,12 +241,12 @@ class SQLAzureFederationsSynchronizer extends AbstractSchemaSynchronizer
$federationType = Type::getType($this->shardManager->getDistributionType()); $federationType = Type::getType($this->shardManager->getDistributionType());
switch ($federationType->getName()) { switch ($federationType->getName()) {
case Type::GUID: case Types::GUID:
$defaultValue = '00000000-0000-0000-0000-000000000000'; $defaultValue = '00000000-0000-0000-0000-000000000000';
break; break;
case Type::INTEGER: case Types::INTEGER:
case Type::SMALLINT: case Types::SMALLINT:
case Type::BIGINT: case Types::BIGINT:
$defaultValue = '0'; $defaultValue = '0';
break; break;
default: default:
......
...@@ -59,7 +59,7 @@ class ArrayType extends Type ...@@ -59,7 +59,7 @@ class ArrayType extends Type
*/ */
public function getName() public function getName()
{ {
return Type::TARRAY; return Types::ARRAY;
} }
/** /**
......
...@@ -15,7 +15,7 @@ class BigIntType extends Type implements PhpIntegerMappingType ...@@ -15,7 +15,7 @@ class BigIntType extends Type implements PhpIntegerMappingType
*/ */
public function getName() public function getName()
{ {
return Type::BIGINT; return Types::BIGINT;
} }
/** /**
......
...@@ -42,7 +42,7 @@ class BinaryType extends Type ...@@ -42,7 +42,7 @@ class BinaryType extends Type
} }
if (! is_resource($value)) { if (! is_resource($value)) {
throw ConversionException::conversionFailed($value, self::BINARY); throw ConversionException::conversionFailed($value, Types::BINARY);
} }
return $value; return $value;
...@@ -53,7 +53,7 @@ class BinaryType extends Type ...@@ -53,7 +53,7 @@ class BinaryType extends Type
*/ */
public function getName() public function getName()
{ {
return Type::BINARY; return Types::BINARY;
} }
/** /**
......
...@@ -42,7 +42,7 @@ class BlobType extends Type ...@@ -42,7 +42,7 @@ class BlobType extends Type
} }
if (! is_resource($value)) { if (! is_resource($value)) {
throw ConversionException::conversionFailed($value, self::BLOB); throw ConversionException::conversionFailed($value, Types::BLOB);
} }
return $value; return $value;
...@@ -53,7 +53,7 @@ class BlobType extends Type ...@@ -53,7 +53,7 @@ class BlobType extends Type
*/ */
public function getName() public function getName()
{ {
return Type::BLOB; return Types::BLOB;
} }
/** /**
......
...@@ -39,7 +39,7 @@ class BooleanType extends Type ...@@ -39,7 +39,7 @@ class BooleanType extends Type
*/ */
public function getName() public function getName()
{ {
return Type::BOOLEAN; return Types::BOOLEAN;
} }
/** /**
......
...@@ -15,7 +15,7 @@ class DateImmutableType extends DateType ...@@ -15,7 +15,7 @@ class DateImmutableType extends DateType
*/ */
public function getName() public function getName()
{ {
return Type::DATE_IMMUTABLE; return Types::DATE_IMMUTABLE;
} }
/** /**
......
...@@ -19,7 +19,7 @@ class DateIntervalType extends Type ...@@ -19,7 +19,7 @@ class DateIntervalType extends Type
*/ */
public function getName() public function getName()
{ {
return Type::DATEINTERVAL; return Types::DATEINTERVAL;
} }
/** /**
......
...@@ -16,7 +16,7 @@ class DateTimeImmutableType extends DateTimeType ...@@ -16,7 +16,7 @@ class DateTimeImmutableType extends DateTimeType
*/ */
public function getName() public function getName()
{ {
return Type::DATETIME_IMMUTABLE; return Types::DATETIME_IMMUTABLE;
} }
/** /**
......
...@@ -17,7 +17,7 @@ class DateTimeType extends Type implements PhpDateTimeMappingType ...@@ -17,7 +17,7 @@ class DateTimeType extends Type implements PhpDateTimeMappingType
*/ */
public function getName() public function getName()
{ {
return Type::DATETIME; return Types::DATETIME_MUTABLE;
} }
/** /**
......
...@@ -15,7 +15,7 @@ class DateTimeTzImmutableType extends DateTimeTzType ...@@ -15,7 +15,7 @@ class DateTimeTzImmutableType extends DateTimeTzType
*/ */
public function getName() public function getName()
{ {
return Type::DATETIMETZ_IMMUTABLE; return Types::DATETIMETZ_IMMUTABLE;
} }
/** /**
......
...@@ -29,7 +29,7 @@ class DateTimeTzType extends Type implements PhpDateTimeMappingType ...@@ -29,7 +29,7 @@ class DateTimeTzType extends Type implements PhpDateTimeMappingType
*/ */
public function getName() public function getName()
{ {
return Type::DATETIMETZ; return Types::DATETIMETZ_MUTABLE;
} }
/** /**
......
...@@ -16,7 +16,7 @@ class DateType extends Type ...@@ -16,7 +16,7 @@ class DateType extends Type
*/ */
public function getName() public function getName()
{ {
return Type::DATE; return Types::DATE_MUTABLE;
} }
/** /**
......
...@@ -14,7 +14,7 @@ class DecimalType extends Type ...@@ -14,7 +14,7 @@ class DecimalType extends Type
*/ */
public function getName() public function getName()
{ {
return Type::DECIMAL; return Types::DECIMAL;
} }
/** /**
......
...@@ -11,7 +11,7 @@ class FloatType extends Type ...@@ -11,7 +11,7 @@ class FloatType extends Type
*/ */
public function getName() public function getName()
{ {
return Type::FLOAT; return Types::FLOAT;
} }
/** /**
......
...@@ -22,7 +22,7 @@ class GuidType extends StringType ...@@ -22,7 +22,7 @@ class GuidType extends StringType
*/ */
public function getName() public function getName()
{ {
return Type::GUID; return Types::GUID;
} }
/** /**
......
...@@ -15,7 +15,7 @@ class IntegerType extends Type implements PhpIntegerMappingType ...@@ -15,7 +15,7 @@ class IntegerType extends Type implements PhpIntegerMappingType
*/ */
public function getName() public function getName()
{ {
return Type::INTEGER; return Types::INTEGER;
} }
/** /**
......
...@@ -33,7 +33,7 @@ class JsonArrayType extends JsonType ...@@ -33,7 +33,7 @@ class JsonArrayType extends JsonType
*/ */
public function getName() public function getName()
{ {
return Type::JSON_ARRAY; return Types::JSON_ARRAY;
} }
/** /**
......
...@@ -69,7 +69,7 @@ class JsonType extends Type ...@@ -69,7 +69,7 @@ class JsonType extends Type
*/ */
public function getName() public function getName()
{ {
return Type::JSON; return Types::JSON;
} }
/** /**
......
...@@ -58,7 +58,7 @@ class ObjectType extends Type ...@@ -58,7 +58,7 @@ class ObjectType extends Type
*/ */
public function getName() public function getName()
{ {
return Type::OBJECT; return Types::OBJECT;
} }
/** /**
......
...@@ -54,7 +54,7 @@ class SimpleArrayType extends Type ...@@ -54,7 +54,7 @@ class SimpleArrayType extends Type
*/ */
public function getName() public function getName()
{ {
return Type::SIMPLE_ARRAY; return Types::SIMPLE_ARRAY;
} }
/** /**
......
...@@ -15,7 +15,7 @@ class SmallIntType extends Type implements PhpIntegerMappingType ...@@ -15,7 +15,7 @@ class SmallIntType extends Type implements PhpIntegerMappingType
*/ */
public function getName() public function getName()
{ {
return Type::SMALLINT; return Types::SMALLINT;
} }
/** /**
......
...@@ -30,6 +30,6 @@ class StringType extends Type ...@@ -30,6 +30,6 @@ class StringType extends Type
*/ */
public function getName() public function getName()
{ {
return Type::STRING; return Types::STRING;
} }
} }
...@@ -32,6 +32,6 @@ class TextType extends Type ...@@ -32,6 +32,6 @@ class TextType extends Type
*/ */
public function getName() public function getName()
{ {
return Type::TEXT; return Types::TEXT;
} }
} }
...@@ -15,7 +15,7 @@ class TimeImmutableType extends TimeType ...@@ -15,7 +15,7 @@ class TimeImmutableType extends TimeType
*/ */
public function getName() public function getName()
{ {
return Type::TIME_IMMUTABLE; return Types::TIME_IMMUTABLE;
} }
/** /**
......
...@@ -16,7 +16,7 @@ class TimeType extends Type ...@@ -16,7 +16,7 @@ class TimeType extends Type
*/ */
public function getName() public function getName()
{ {
return Type::TIME; return Types::TIME_MUTABLE;
} }
/** /**
......
...@@ -18,61 +18,110 @@ use function substr; ...@@ -18,61 +18,110 @@ use function substr;
*/ */
abstract class Type abstract class Type
{ {
public const BIGINT = 'bigint'; /** @deprecated Use {@see DefaultTypes::BIGINT} instead. */
public const BINARY = 'binary'; public const BIGINT = Types::BIGINT;
public const BLOB = 'blob';
public const BOOLEAN = 'boolean'; /** @deprecated Use {@see DefaultTypes::BINARY} instead. */
public const DATE = 'date'; public const BINARY = Types::BINARY;
public const DATE_IMMUTABLE = 'date_immutable';
public const DATEINTERVAL = 'dateinterval'; /** @deprecated Use {@see DefaultTypes::BLOB} instead. */
public const DATETIME = 'datetime'; public const BLOB = Types::BLOB;
public const DATETIME_IMMUTABLE = 'datetime_immutable';
public const DATETIMETZ = 'datetimetz'; /** @deprecated Use {@see DefaultTypes::BOOLEAN} instead. */
public const DATETIMETZ_IMMUTABLE = 'datetimetz_immutable'; public const BOOLEAN = Types::BOOLEAN;
public const DECIMAL = 'decimal';
public const FLOAT = 'float'; /** @deprecated Use {@see DefaultTypes::DATE_MUTABLE} instead. */
public const GUID = 'guid'; public const DATE = Types::DATE_MUTABLE;
public const INTEGER = 'integer';
public const JSON = 'json'; /** @deprecated Use {@see DefaultTypes::DATE_IMMUTABLE} instead. */
public const JSON_ARRAY = 'json_array'; public const DATE_IMMUTABLE = Types::DATE_IMMUTABLE;
public const OBJECT = 'object';
public const SIMPLE_ARRAY = 'simple_array'; /** @deprecated Use {@see DefaultTypes::DATEINTERVAL} instead. */
public const SMALLINT = 'smallint'; public const DATEINTERVAL = Types::DATEINTERVAL;
public const STRING = 'string';
public const TARRAY = 'array'; /** @deprecated Use {@see DefaultTypes::DATETIME_MUTABLE} instead. */
public const TEXT = 'text'; public const DATETIME = Types::DATETIME_MUTABLE;
public const TIME = 'time';
public const TIME_IMMUTABLE = 'time_immutable'; /** @deprecated Use {@see DefaultTypes::DATETIME_IMMUTABLE} instead. */
public const DATETIME_IMMUTABLE = Types::DATETIME_IMMUTABLE;
/** @deprecated Use {@see DefaultTypes::DATETIMETZ_MUTABLE} instead. */
public const DATETIMETZ = Types::DATETIMETZ_MUTABLE;
/** @deprecated Use {@see DefaultTypes::DATETIMETZ_IMMUTABLE} instead. */
public const DATETIMETZ_IMMUTABLE = Types::DATETIMETZ_IMMUTABLE;
/** @deprecated Use {@see DefaultTypes::DECIMAL} instead. */
public const DECIMAL = Types::DECIMAL;
/** @deprecated Use {@see DefaultTypes::FLOAT} instead. */
public const FLOAT = Types::FLOAT;
/** @deprecated Use {@see DefaultTypes::GUID} instead. */
public const GUID = Types::GUID;
/** @deprecated Use {@see DefaultTypes::INTEGER} instead. */
public const INTEGER = Types::INTEGER;
/** @deprecated Use {@see DefaultTypes::JSON} instead. */
public const JSON = Types::JSON;
/** @deprecated Use {@see DefaultTypes::JSON_ARRAY} instead. */
public const JSON_ARRAY = Types::JSON_ARRAY;
/** @deprecated Use {@see DefaultTypes::OBJECT} instead. */
public const OBJECT = Types::OBJECT;
/** @deprecated Use {@see DefaultTypes::SIMPLE_ARRAY} instead. */
public const SIMPLE_ARRAY = Types::SIMPLE_ARRAY;
/** @deprecated Use {@see DefaultTypes::SMALLINT} instead. */
public const SMALLINT = Types::SMALLINT;
/** @deprecated Use {@see DefaultTypes::STRING} instead. */
public const STRING = Types::STRING;
/** @deprecated Use {@see DefaultTypes::ARRAY} instead. */
public const TARRAY = Types::ARRAY;
/** @deprecated Use {@see DefaultTypes::TEXT} instead. */
public const TEXT = Types::TEXT;
/** @deprecated Use {@see DefaultTypes::TIME_MUTABLE} instead. */
public const TIME = Types::TIME_MUTABLE;
/** @deprecated Use {@see DefaultTypes::TIME_IMMUTABLE} instead. */
public const TIME_IMMUTABLE = Types::TIME_IMMUTABLE;
/** /**
* The map of supported doctrine mapping types. * The map of supported doctrine mapping types.
*/ */
private const BUILTIN_TYPES_MAP = [ private const BUILTIN_TYPES_MAP = [
self::BIGINT => BigIntType::class, Types::ARRAY => ArrayType::class,
self::BINARY => BinaryType::class, Types::BIGINT => BigIntType::class,
self::BLOB => BlobType::class, Types::BINARY => BinaryType::class,
self::BOOLEAN => BooleanType::class, Types::BLOB => BlobType::class,
self::DATE => DateType::class, Types::BOOLEAN => BooleanType::class,
self::DATE_IMMUTABLE => DateImmutableType::class, Types::DATE_MUTABLE => DateType::class,
self::DATEINTERVAL => DateIntervalType::class, Types::DATE_IMMUTABLE => DateImmutableType::class,
self::DATETIME => DateTimeType::class, Types::DATEINTERVAL => DateIntervalType::class,
self::DATETIME_IMMUTABLE => DateTimeImmutableType::class, Types::DATETIME_MUTABLE => DateTimeType::class,
self::DATETIMETZ => DateTimeTzType::class, Types::DATETIME_IMMUTABLE => DateTimeImmutableType::class,
self::DATETIMETZ_IMMUTABLE => DateTimeTzImmutableType::class, Types::DATETIMETZ_MUTABLE => DateTimeTzType::class,
self::DECIMAL => DecimalType::class, Types::DATETIMETZ_IMMUTABLE => DateTimeTzImmutableType::class,
self::FLOAT => FloatType::class, Types::DECIMAL => DecimalType::class,
self::GUID => GuidType::class, Types::FLOAT => FloatType::class,
self::INTEGER => IntegerType::class, Types::GUID => GuidType::class,
self::JSON => JsonType::class, Types::INTEGER => IntegerType::class,
self::JSON_ARRAY => JsonArrayType::class, Types::JSON => JsonType::class,
self::OBJECT => ObjectType::class, Types::JSON_ARRAY => JsonArrayType::class,
self::SIMPLE_ARRAY => SimpleArrayType::class, Types::OBJECT => ObjectType::class,
self::SMALLINT => SmallIntType::class, Types::SIMPLE_ARRAY => SimpleArrayType::class,
self::STRING => StringType::class, Types::SMALLINT => SmallIntType::class,
self::TARRAY => ArrayType::class, Types::STRING => StringType::class,
self::TEXT => TextType::class, Types::TEXT => TextType::class,
self::TIME => TimeType::class, Types::TIME_MUTABLE => TimeType::class,
self::TIME_IMMUTABLE => TimeImmutableType::class, Types::TIME_IMMUTABLE => TimeImmutableType::class,
]; ];
/** @var TypeRegistry|null */ /** @var TypeRegistry|null */
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Types;
/**
* Default built-in types provided by Doctrine DBAL.
*/
final class Types
{
public const ARRAY = 'array';
public const BIGINT = 'bigint';
public const BINARY = 'binary';
public const BLOB = 'blob';
public const BOOLEAN = 'boolean';
public const DATE_MUTABLE = 'date';
public const DATE_IMMUTABLE = 'date_immutable';
public const DATEINTERVAL = 'dateinterval';
public const DATETIME_MUTABLE = 'datetime';
public const DATETIME_IMMUTABLE = 'datetime_immutable';
public const DATETIMETZ_MUTABLE = 'datetimetz';
public const DATETIMETZ_IMMUTABLE = 'datetimetz_immutable';
public const DECIMAL = 'decimal';
public const FLOAT = 'float';
public const GUID = 'guid';
public const INTEGER = 'integer';
public const JSON = 'json';
public const OBJECT = 'object';
public const SIMPLE_ARRAY = 'simple_array';
public const SMALLINT = 'smallint';
public const STRING = 'string';
public const TEXT = 'text';
public const TIME_MUTABLE = 'time';
public const TIME_IMMUTABLE = 'time_immutable';
/** @deprecated json_array type is deprecated, use {@see DefaultTypes::JSON} instead. */
public const JSON_ARRAY = 'json_array';
private function __construct()
{
}
}
...@@ -16,7 +16,7 @@ class VarDateTimeImmutableType extends VarDateTimeType ...@@ -16,7 +16,7 @@ class VarDateTimeImmutableType extends VarDateTimeType
*/ */
public function getName() public function getName()
{ {
return Type::DATETIME_IMMUTABLE; return Types::DATETIME_IMMUTABLE;
} }
/** /**
......
...@@ -8,7 +8,7 @@ use Doctrine\DBAL\Driver\Connection as DriverConnection; ...@@ -8,7 +8,7 @@ use Doctrine\DBAL\Driver\Connection as DriverConnection;
use Doctrine\DBAL\DriverManager; use Doctrine\DBAL\DriverManager;
use Doctrine\DBAL\ParameterType; use Doctrine\DBAL\ParameterType;
use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Types\Type; use Doctrine\DBAL\Types\Types;
use Doctrine\Tests\DbalFunctionalTestCase; use Doctrine\Tests\DbalFunctionalTestCase;
use Error; use Error;
use Exception; use Exception;
...@@ -252,7 +252,7 @@ class ConnectionTest extends DbalFunctionalTestCase ...@@ -252,7 +252,7 @@ class ConnectionTest extends DbalFunctionalTestCase
public function testQuote() public function testQuote()
{ {
self::assertEquals( self::assertEquals(
$this->connection->quote('foo', Type::STRING), $this->connection->quote('foo', Types::STRING),
$this->connection->quote('foo', ParameterType::STRING) $this->connection->quote('foo', ParameterType::STRING)
); );
} }
......
...@@ -16,7 +16,7 @@ use Doctrine\DBAL\Platforms\SqlitePlatform; ...@@ -16,7 +16,7 @@ use Doctrine\DBAL\Platforms\SqlitePlatform;
use Doctrine\DBAL\Platforms\TrimMode; use Doctrine\DBAL\Platforms\TrimMode;
use Doctrine\DBAL\Schema\Table; use Doctrine\DBAL\Schema\Table;
use Doctrine\DBAL\Statement; use Doctrine\DBAL\Statement;
use Doctrine\DBAL\Types\Type; use Doctrine\DBAL\Types\Types;
use Doctrine\Tests\DbalFunctionalTestCase; use Doctrine\Tests\DbalFunctionalTestCase;
use PDO; use PDO;
use const CASE_LOWER; use const CASE_LOWER;
...@@ -225,7 +225,11 @@ class DataAccessTest extends DbalFunctionalTestCase ...@@ -225,7 +225,11 @@ class DataAccessTest extends DbalFunctionalTestCase
$datetime = new DateTime($datetimeString); $datetime = new DateTime($datetimeString);
$sql = 'SELECT test_int, test_datetime FROM fetch_table WHERE test_int = ? AND test_datetime = ?'; $sql = 'SELECT test_int, test_datetime FROM fetch_table WHERE test_int = ? AND test_datetime = ?';
$data = $this->connection->fetchAll($sql, [1, $datetime], [ParameterType::STRING, Type::DATETIME]); $data = $this->connection->fetchAll(
$sql,
[1, $datetime],
[ParameterType::STRING, Types::DATETIME_MUTABLE]
);
self::assertCount(1, $data); self::assertCount(1, $data);
...@@ -297,7 +301,11 @@ class DataAccessTest extends DbalFunctionalTestCase ...@@ -297,7 +301,11 @@ class DataAccessTest extends DbalFunctionalTestCase
$datetime = new DateTime($datetimeString); $datetime = new DateTime($datetimeString);
$sql = 'SELECT test_int, test_datetime FROM fetch_table WHERE test_int = ? AND test_datetime = ?'; $sql = 'SELECT test_int, test_datetime FROM fetch_table WHERE test_int = ? AND test_datetime = ?';
$row = $this->connection->fetchAssoc($sql, [1, $datetime], [ParameterType::STRING, Type::DATETIME]); $row = $this->connection->fetchAssoc(
$sql,
[1, $datetime],
[ParameterType::STRING, Types::DATETIME_MUTABLE]
);
self::assertNotFalse($row); self::assertNotFalse($row);
...@@ -338,7 +346,11 @@ class DataAccessTest extends DbalFunctionalTestCase ...@@ -338,7 +346,11 @@ class DataAccessTest extends DbalFunctionalTestCase
$datetime = new DateTime($datetimeString); $datetime = new DateTime($datetimeString);
$sql = 'SELECT test_int, test_datetime FROM fetch_table WHERE test_int = ? AND test_datetime = ?'; $sql = 'SELECT test_int, test_datetime FROM fetch_table WHERE test_int = ? AND test_datetime = ?';
$row = $this->connection->fetchArray($sql, [1, $datetime], [ParameterType::STRING, Type::DATETIME]); $row = $this->connection->fetchArray(
$sql,
[1, $datetime],
[ParameterType::STRING, Types::DATETIME_MUTABLE]
);
self::assertNotFalse($row); self::assertNotFalse($row);
...@@ -383,7 +395,12 @@ class DataAccessTest extends DbalFunctionalTestCase ...@@ -383,7 +395,12 @@ class DataAccessTest extends DbalFunctionalTestCase
$datetime = new DateTime($datetimeString); $datetime = new DateTime($datetimeString);
$sql = 'SELECT test_int, test_datetime FROM fetch_table WHERE test_int = ? AND test_datetime = ?'; $sql = 'SELECT test_int, test_datetime FROM fetch_table WHERE test_int = ? AND test_datetime = ?';
$column = $this->connection->fetchColumn($sql, [1, $datetime], 1, [ParameterType::STRING, Type::DATETIME]); $column = $this->connection->fetchColumn(
$sql,
[1, $datetime],
1,
[ParameterType::STRING, Types::DATETIME_MUTABLE]
);
self::assertNotFalse($column); self::assertNotFalse($column);
...@@ -415,7 +432,7 @@ class DataAccessTest extends DbalFunctionalTestCase ...@@ -415,7 +432,7 @@ class DataAccessTest extends DbalFunctionalTestCase
$stmt = $this->connection->executeQuery( $stmt = $this->connection->executeQuery(
$sql, $sql,
[1 => new DateTime('2010-01-01 10:10:10')], [1 => new DateTime('2010-01-01 10:10:10')],
[1 => Type::DATETIME] [1 => Types::DATETIME_MUTABLE]
); );
self::assertEquals(1, $stmt->fetchColumn()); self::assertEquals(1, $stmt->fetchColumn());
...@@ -436,14 +453,14 @@ class DataAccessTest extends DbalFunctionalTestCase ...@@ -436,14 +453,14 @@ class DataAccessTest extends DbalFunctionalTestCase
], [ ], [
1 => ParameterType::INTEGER, 1 => ParameterType::INTEGER,
2 => ParameterType::STRING, 2 => ParameterType::STRING,
3 => Type::DATETIME, 3 => Types::DATETIME_MUTABLE,
]); ]);
self::assertEquals(1, $affectedRows); self::assertEquals(1, $affectedRows);
self::assertEquals(1, $this->connection->executeQuery( self::assertEquals(1, $this->connection->executeQuery(
'SELECT count(*) AS c FROM fetch_table WHERE test_datetime = ?', 'SELECT count(*) AS c FROM fetch_table WHERE test_datetime = ?',
[1 => $datetime], [1 => $datetime],
[1 => Type::DATETIME] [1 => Types::DATETIME_MUTABLE]
)->fetchColumn()); )->fetchColumn());
} }
...@@ -454,7 +471,7 @@ class DataAccessTest extends DbalFunctionalTestCase ...@@ -454,7 +471,7 @@ class DataAccessTest extends DbalFunctionalTestCase
{ {
$sql = 'SELECT count(*) AS c FROM fetch_table WHERE test_datetime = ?'; $sql = 'SELECT count(*) AS c FROM fetch_table WHERE test_datetime = ?';
$stmt = $this->connection->prepare($sql); $stmt = $this->connection->prepare($sql);
$stmt->bindValue(1, new DateTime('2010-01-01 10:10:10'), Type::DATETIME); $stmt->bindValue(1, new DateTime('2010-01-01 10:10:10'), Types::DATETIME_MUTABLE);
$stmt->execute(); $stmt->execute();
self::assertEquals(1, $stmt->fetchColumn()); self::assertEquals(1, $stmt->fetchColumn());
......
...@@ -9,6 +9,7 @@ use Doctrine\DBAL\Schema\Comparator; ...@@ -9,6 +9,7 @@ use Doctrine\DBAL\Schema\Comparator;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Schema\Table; use Doctrine\DBAL\Schema\Table;
use Doctrine\DBAL\Types\Type; use Doctrine\DBAL\Types\Type;
use Doctrine\DBAL\Types\Types;
use Doctrine\Tests\Types\MySqlPointType; use Doctrine\Tests\Types\MySqlPointType;
use function implode; use function implode;
use function sprintf; use function sprintf;
...@@ -415,7 +416,7 @@ class MySqlSchemaManagerTest extends SchemaManagerFunctionalTestCase ...@@ -415,7 +416,7 @@ class MySqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
$columns = $this->schemaManager->listTableColumns('test_mysql_json'); $columns = $this->schemaManager->listTableColumns('test_mysql_json');
self::assertSame(Type::JSON, $columns['col_json']->getType()->getName()); self::assertSame(Types::JSON, $columns['col_json']->getType()->getName());
} }
public function testColumnDefaultCurrentTimestamp() : void public function testColumnDefaultCurrentTimestamp() : void
......
...@@ -5,7 +5,7 @@ namespace Doctrine\Tests\DBAL\Functional\Schema; ...@@ -5,7 +5,7 @@ namespace Doctrine\Tests\DBAL\Functional\Schema;
use Doctrine\DBAL\Schema; use Doctrine\DBAL\Schema;
use Doctrine\DBAL\Schema\Table; use Doctrine\DBAL\Schema\Table;
use Doctrine\DBAL\Types\BinaryType; use Doctrine\DBAL\Types\BinaryType;
use Doctrine\DBAL\Types\Type; use Doctrine\DBAL\Types\Types;
use Doctrine\Tests\TestUtil; use Doctrine\Tests\TestUtil;
use function array_map; use function array_map;
...@@ -232,7 +232,7 @@ class OracleSchemaManagerTest extends SchemaManagerFunctionalTestCase ...@@ -232,7 +232,7 @@ class OracleSchemaManagerTest extends SchemaManagerFunctionalTestCase
$this->schemaManager->dropAndCreateTable($table); $this->schemaManager->dropAndCreateTable($table);
$otherTable = new Table($table->getName()); $otherTable = new Table($table->getName());
$otherTable->addColumn('id', Type::STRING); $otherTable->addColumn('id', Types::STRING);
TestUtil::getTempConnection()->getSchemaManager()->dropAndCreateTable($otherTable); TestUtil::getTempConnection()->getSchemaManager()->dropAndCreateTable($otherTable);
$columns = $this->schemaManager->listTableColumns($table->getName(), $this->connection->getUsername()); $columns = $this->schemaManager->listTableColumns($table->getName(), $this->connection->getUsername());
......
...@@ -12,6 +12,7 @@ use Doctrine\DBAL\Schema\TableDiff; ...@@ -12,6 +12,7 @@ use Doctrine\DBAL\Schema\TableDiff;
use Doctrine\DBAL\Types\BlobType; use Doctrine\DBAL\Types\BlobType;
use Doctrine\DBAL\Types\DecimalType; use Doctrine\DBAL\Types\DecimalType;
use Doctrine\DBAL\Types\Type; use Doctrine\DBAL\Types\Type;
use Doctrine\DBAL\Types\Types;
use function array_map; use function array_map;
use function array_pop; use function array_pop;
use function count; use function count;
...@@ -410,8 +411,8 @@ class PostgreSqlSchemaManagerTest extends SchemaManagerFunctionalTestCase ...@@ -410,8 +411,8 @@ class PostgreSqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
public function jsonbColumnTypeProvider() : array public function jsonbColumnTypeProvider() : array
{ {
return [ return [
[Type::JSON], [Types::JSON],
[Type::JSON_ARRAY], [Types::JSON_ARRAY],
]; ];
} }
......
...@@ -8,6 +8,7 @@ use Doctrine\DBAL\Schema; ...@@ -8,6 +8,7 @@ use Doctrine\DBAL\Schema;
use Doctrine\DBAL\Schema\Table; use Doctrine\DBAL\Schema\Table;
use Doctrine\DBAL\Types\BlobType; use Doctrine\DBAL\Types\BlobType;
use Doctrine\DBAL\Types\Type; use Doctrine\DBAL\Types\Type;
use Doctrine\DBAL\Types\Types;
use SQLite3; use SQLite3;
use function array_map; use function array_map;
use function dirname; use function dirname;
...@@ -206,8 +207,8 @@ SQL; ...@@ -206,8 +207,8 @@ SQL;
self::assertArrayHasKey('foo', $columns); self::assertArrayHasKey('foo', $columns);
self::assertArrayHasKey('bar', $columns); self::assertArrayHasKey('bar', $columns);
self::assertSame(Type::getType(Type::STRING), $columns['foo']->getType()); self::assertSame(Type::getType(Types::STRING), $columns['foo']->getType());
self::assertSame(Type::getType(Type::TEXT), $columns['bar']->getType()); self::assertSame(Type::getType(Types::TEXT), $columns['bar']->getType());
self::assertSame(64, $columns['foo']->getLength()); self::assertSame(64, $columns['foo']->getLength());
self::assertSame(100, $columns['bar']->getLength()); self::assertSame(100, $columns['bar']->getLength());
......
...@@ -10,6 +10,7 @@ use Doctrine\DBAL\Schema\Index; ...@@ -10,6 +10,7 @@ use Doctrine\DBAL\Schema\Index;
use Doctrine\DBAL\Schema\Table; use Doctrine\DBAL\Schema\Table;
use Doctrine\DBAL\Schema\TableDiff; use Doctrine\DBAL\Schema\TableDiff;
use Doctrine\DBAL\Types\Type; use Doctrine\DBAL\Types\Type;
use Doctrine\DBAL\Types\Types;
class DB2PlatformTest extends AbstractPlatformTestCase class DB2PlatformTest extends AbstractPlatformTestCase
{ {
...@@ -279,7 +280,7 @@ class DB2PlatformTest extends AbstractPlatformTestCase ...@@ -279,7 +280,7 @@ class DB2PlatformTest extends AbstractPlatformTestCase
{ {
$data = parent::getIsCommentedDoctrineType(); $data = parent::getIsCommentedDoctrineType();
$data[Type::BOOLEAN] = [Type::getType(Type::BOOLEAN), true]; $data[Types::BOOLEAN] = [Type::getType(Types::BOOLEAN), true];
return $data; return $data;
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
namespace Doctrine\Tests\DBAL\Platforms; namespace Doctrine\Tests\DBAL\Platforms;
use Doctrine\DBAL\Platforms\MariaDb1027Platform; use Doctrine\DBAL\Platforms\MariaDb1027Platform;
use Doctrine\DBAL\Types\Type; use Doctrine\DBAL\Types\Types;
class MariaDb1027PlatformTest extends AbstractMySQLPlatformTestCase class MariaDb1027PlatformTest extends AbstractMySQLPlatformTestCase
{ {
...@@ -33,7 +33,7 @@ class MariaDb1027PlatformTest extends AbstractMySQLPlatformTestCase ...@@ -33,7 +33,7 @@ class MariaDb1027PlatformTest extends AbstractMySQLPlatformTestCase
public function testInitializesJsonTypeMapping() : void public function testInitializesJsonTypeMapping() : void
{ {
self::assertTrue($this->platform->hasDoctrineTypeMappingFor('json')); self::assertTrue($this->platform->hasDoctrineTypeMappingFor('json'));
self::assertSame(Type::JSON, $this->platform->getDoctrineTypeMapping('json')); self::assertSame(Types::JSON, $this->platform->getDoctrineTypeMapping('json'));
} }
/** /**
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
namespace Doctrine\Tests\DBAL\Platforms; namespace Doctrine\Tests\DBAL\Platforms;
use Doctrine\DBAL\Platforms\MySQL57Platform; use Doctrine\DBAL\Platforms\MySQL57Platform;
use Doctrine\DBAL\Types\Type; use Doctrine\DBAL\Types\Types;
class MySQL57PlatformTest extends AbstractMySQLPlatformTestCase class MySQL57PlatformTest extends AbstractMySQLPlatformTestCase
{ {
...@@ -28,7 +28,7 @@ class MySQL57PlatformTest extends AbstractMySQLPlatformTestCase ...@@ -28,7 +28,7 @@ class MySQL57PlatformTest extends AbstractMySQLPlatformTestCase
public function testInitializesJsonTypeMapping() public function testInitializesJsonTypeMapping()
{ {
self::assertTrue($this->platform->hasDoctrineTypeMappingFor('json')); self::assertTrue($this->platform->hasDoctrineTypeMappingFor('json'));
self::assertSame(Type::JSON, $this->platform->getDoctrineTypeMapping('json')); self::assertSame(Types::JSON, $this->platform->getDoctrineTypeMapping('json'));
} }
/** /**
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
namespace Doctrine\Tests\DBAL\Platforms; namespace Doctrine\Tests\DBAL\Platforms;
use Doctrine\DBAL\Platforms\PostgreSQL92Platform; use Doctrine\DBAL\Platforms\PostgreSQL92Platform;
use Doctrine\DBAL\Types\Type; use Doctrine\DBAL\Types\Types;
class PostgreSQL92PlatformTest extends AbstractPostgreSqlPlatformTestCase class PostgreSQL92PlatformTest extends AbstractPostgreSqlPlatformTestCase
{ {
...@@ -55,7 +55,7 @@ class PostgreSQL92PlatformTest extends AbstractPostgreSqlPlatformTestCase ...@@ -55,7 +55,7 @@ class PostgreSQL92PlatformTest extends AbstractPostgreSqlPlatformTestCase
public function testInitializesJsonTypeMapping() public function testInitializesJsonTypeMapping()
{ {
self::assertTrue($this->platform->hasDoctrineTypeMappingFor('json')); self::assertTrue($this->platform->hasDoctrineTypeMappingFor('json'));
self::assertEquals(Type::JSON, $this->platform->getDoctrineTypeMapping('json')); self::assertEquals(Types::JSON, $this->platform->getDoctrineTypeMapping('json'));
} }
/** /**
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
namespace Doctrine\Tests\DBAL\Platforms; namespace Doctrine\Tests\DBAL\Platforms;
use Doctrine\DBAL\Platforms\PostgreSQL94Platform; use Doctrine\DBAL\Platforms\PostgreSQL94Platform;
use Doctrine\DBAL\Types\Type; use Doctrine\DBAL\Types\Types;
class PostgreSQL94PlatformTest extends PostgreSQL92PlatformTest class PostgreSQL94PlatformTest extends PostgreSQL92PlatformTest
{ {
...@@ -26,6 +26,6 @@ class PostgreSQL94PlatformTest extends PostgreSQL92PlatformTest ...@@ -26,6 +26,6 @@ class PostgreSQL94PlatformTest extends PostgreSQL92PlatformTest
{ {
parent::testInitializesJsonTypeMapping(); parent::testInitializesJsonTypeMapping();
self::assertTrue($this->platform->hasDoctrineTypeMappingFor('jsonb')); self::assertTrue($this->platform->hasDoctrineTypeMappingFor('jsonb'));
self::assertEquals(Type::JSON, $this->platform->getDoctrineTypeMapping('jsonb')); self::assertEquals(Types::JSON, $this->platform->getDoctrineTypeMapping('jsonb'));
} }
} }
...@@ -5,6 +5,7 @@ namespace Doctrine\Tests\DBAL\Schema; ...@@ -5,6 +5,7 @@ namespace Doctrine\Tests\DBAL\Schema;
use Doctrine\DBAL\Schema\Column; use Doctrine\DBAL\Schema\Column;
use Doctrine\DBAL\Schema\ColumnDiff; use Doctrine\DBAL\Schema\ColumnDiff;
use Doctrine\DBAL\Types\Type; use Doctrine\DBAL\Types\Type;
use Doctrine\DBAL\Types\Types;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
class ColumnDiffTest extends TestCase class ColumnDiffTest extends TestCase
...@@ -14,8 +15,8 @@ class ColumnDiffTest extends TestCase ...@@ -14,8 +15,8 @@ class ColumnDiffTest extends TestCase
*/ */
public function testPreservesOldColumnNameQuotation() public function testPreservesOldColumnNameQuotation()
{ {
$fromColumn = new Column('"foo"', Type::getType(Type::INTEGER)); $fromColumn = new Column('"foo"', Type::getType(Types::INTEGER));
$toColumn = new Column('bar', Type::getType(Type::INTEGER)); $toColumn = new Column('bar', Type::getType(Types::INTEGER));
$columnDiff = new ColumnDiff('"foo"', $toColumn, []); $columnDiff = new ColumnDiff('"foo"', $toColumn, []);
self::assertTrue($columnDiff->getOldColumnName()->isQuoted()); self::assertTrue($columnDiff->getOldColumnName()->isQuoted());
......
...@@ -7,6 +7,7 @@ use Doctrine\DBAL\Platforms\SqlitePlatform; ...@@ -7,6 +7,7 @@ use Doctrine\DBAL\Platforms\SqlitePlatform;
use Doctrine\DBAL\Platforms\SQLServerPlatform; use Doctrine\DBAL\Platforms\SQLServerPlatform;
use Doctrine\DBAL\Schema\Column; use Doctrine\DBAL\Schema\Column;
use Doctrine\DBAL\Types\Type; use Doctrine\DBAL\Types\Type;
use Doctrine\DBAL\Types\Types;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
class ColumnTest extends TestCase class ColumnTest extends TestCase
...@@ -74,10 +75,10 @@ class ColumnTest extends TestCase ...@@ -74,10 +75,10 @@ class ColumnTest extends TestCase
*/ */
public function testOptionsShouldNotBeIgnored() : void public function testOptionsShouldNotBeIgnored() : void
{ {
$col1 = new Column('bar', Type::getType(Type::INTEGER), ['unknown_option' => 'bar', 'notnull' => true]); $col1 = new Column('bar', Type::getType(Types::INTEGER), ['unknown_option' => 'bar', 'notnull' => true]);
self::assertTrue($col1->getNotnull()); self::assertTrue($col1->getNotnull());
$col2 = new Column('bar', Type::getType(Type::INTEGER), ['unknown_option' => 'bar', 'notnull' => false]); $col2 = new Column('bar', Type::getType(Types::INTEGER), ['unknown_option' => 'bar', 'notnull' => false]);
self::assertFalse($col2->getNotnull()); self::assertFalse($col2->getNotnull());
} }
......
...@@ -7,6 +7,7 @@ use Doctrine\DBAL\Platforms\AbstractPlatform; ...@@ -7,6 +7,7 @@ use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Types\BinaryType; use Doctrine\DBAL\Types\BinaryType;
use Doctrine\DBAL\Types\ConversionException; use Doctrine\DBAL\Types\ConversionException;
use Doctrine\DBAL\Types\Type; use Doctrine\DBAL\Types\Type;
use Doctrine\DBAL\Types\Types;
use Doctrine\Tests\DbalTestCase; use Doctrine\Tests\DbalTestCase;
use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\MockObject\MockObject;
use function base64_encode; use function base64_encode;
...@@ -37,7 +38,7 @@ class BinaryTest extends DbalTestCase ...@@ -37,7 +38,7 @@ class BinaryTest extends DbalTestCase
public function testReturnsName() public function testReturnsName()
{ {
self::assertSame(Type::BINARY, $this->type->getName()); self::assertSame(Types::BINARY, $this->type->getName());
} }
public function testReturnsSQLDeclaration() public function testReturnsSQLDeclaration()
......
...@@ -6,6 +6,7 @@ use Doctrine\DBAL\ParameterType; ...@@ -6,6 +6,7 @@ use Doctrine\DBAL\ParameterType;
use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Types\JsonArrayType; use Doctrine\DBAL\Types\JsonArrayType;
use Doctrine\DBAL\Types\Type; use Doctrine\DBAL\Types\Type;
use Doctrine\DBAL\Types\Types;
use Doctrine\Tests\DbalTestCase; use Doctrine\Tests\DbalTestCase;
use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\MockObject\MockObject;
use function base64_encode; use function base64_encode;
...@@ -36,7 +37,7 @@ class JsonArrayTest extends DbalTestCase ...@@ -36,7 +37,7 @@ class JsonArrayTest extends DbalTestCase
public function testReturnsName() public function testReturnsName()
{ {
self::assertSame(Type::JSON_ARRAY, $this->type->getName()); self::assertSame(Types::JSON_ARRAY, $this->type->getName());
} }
public function testReturnsSQLDeclaration() public function testReturnsSQLDeclaration()
......
...@@ -7,6 +7,7 @@ use Doctrine\DBAL\Platforms\AbstractPlatform; ...@@ -7,6 +7,7 @@ use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Types\ConversionException; use Doctrine\DBAL\Types\ConversionException;
use Doctrine\DBAL\Types\JsonType; use Doctrine\DBAL\Types\JsonType;
use Doctrine\DBAL\Types\Type; use Doctrine\DBAL\Types\Type;
use Doctrine\DBAL\Types\Types;
use Doctrine\Tests\DbalTestCase; use Doctrine\Tests\DbalTestCase;
use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\MockObject\MockObject;
use function base64_encode; use function base64_encode;
...@@ -37,7 +38,7 @@ class JsonTest extends DbalTestCase ...@@ -37,7 +38,7 @@ class JsonTest extends DbalTestCase
public function testReturnsName() public function testReturnsName()
{ {
self::assertSame(Type::JSON, $this->type->getName()); self::assertSame(Types::JSON, $this->type->getName());
} }
public function testReturnsSQLDeclaration() public function testReturnsSQLDeclaration()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment