Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
ab8d709f
Unverified
Commit
ab8d709f
authored
May 29, 2019
by
Sergei Morozov
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3569 from jwage/types-namespace-types
Add proper types to Doctrine\DBAL\Types namespace.
parents
4b3f0ee1
0382f44f
Changes
31
Hide whitespace changes
Inline
Side-by-side
Showing
31 changed files
with
96 additions
and
117 deletions
+96
-117
ArrayType.php
lib/Doctrine/DBAL/Types/ArrayType.php
+3
-3
BigIntType.php
lib/Doctrine/DBAL/Types/BigIntType.php
+3
-3
BinaryType.php
lib/Doctrine/DBAL/Types/BinaryType.php
+3
-3
BlobType.php
lib/Doctrine/DBAL/Types/BlobType.php
+3
-3
BooleanType.php
lib/Doctrine/DBAL/Types/BooleanType.php
+3
-3
DateImmutableType.php
lib/Doctrine/DBAL/Types/DateImmutableType.php
+2
-2
DateIntervalType.php
lib/Doctrine/DBAL/Types/DateIntervalType.php
+3
-3
DateTimeImmutableType.php
lib/Doctrine/DBAL/Types/DateTimeImmutableType.php
+2
-2
DateTimeType.php
lib/Doctrine/DBAL/Types/DateTimeType.php
+2
-2
DateTimeTzImmutableType.php
lib/Doctrine/DBAL/Types/DateTimeTzImmutableType.php
+2
-2
DateTimeTzType.php
lib/Doctrine/DBAL/Types/DateTimeTzType.php
+2
-2
DateType.php
lib/Doctrine/DBAL/Types/DateType.php
+2
-2
DecimalType.php
lib/Doctrine/DBAL/Types/DecimalType.php
+2
-2
ValueNotConvertible.php
lib/Doctrine/DBAL/Types/Exception/ValueNotConvertible.php
+4
-1
FloatType.php
lib/Doctrine/DBAL/Types/FloatType.php
+2
-2
GuidType.php
lib/Doctrine/DBAL/Types/GuidType.php
+3
-3
IntegerType.php
lib/Doctrine/DBAL/Types/IntegerType.php
+3
-3
JsonType.php
lib/Doctrine/DBAL/Types/JsonType.php
+3
-3
ObjectType.php
lib/Doctrine/DBAL/Types/ObjectType.php
+3
-3
SimpleArrayType.php
lib/Doctrine/DBAL/Types/SimpleArrayType.php
+3
-3
SmallIntType.php
lib/Doctrine/DBAL/Types/SmallIntType.php
+3
-3
StringType.php
lib/Doctrine/DBAL/Types/StringType.php
+2
-2
TextType.php
lib/Doctrine/DBAL/Types/TextType.php
+2
-2
TimeImmutableType.php
lib/Doctrine/DBAL/Types/TimeImmutableType.php
+2
-2
TimeType.php
lib/Doctrine/DBAL/Types/TimeType.php
+2
-2
Type.php
lib/Doctrine/DBAL/Types/Type.php
+17
-45
TypeRegistry.php
lib/Doctrine/DBAL/Types/TypeRegistry.php
+5
-1
VarDateTimeImmutableType.php
lib/Doctrine/DBAL/Types/VarDateTimeImmutableType.php
+2
-2
PostgreSqlSchemaManagerTest.php
...ts/DBAL/Functional/Schema/PostgreSqlSchemaManagerTest.php
+2
-2
CommentedType.php
tests/Doctrine/Tests/Types/CommentedType.php
+3
-3
MySqlPointType.php
tests/Doctrine/Tests/Types/MySqlPointType.php
+3
-3
No files found.
lib/Doctrine/DBAL/Types/ArrayType.php
View file @
ab8d709f
...
...
@@ -21,7 +21,7 @@ class ArrayType extends Type
/**
* {@inheritdoc}
*/
public
function
getSQLDeclaration
(
array
$fieldDeclaration
,
AbstractPlatform
$platform
)
public
function
getSQLDeclaration
(
array
$fieldDeclaration
,
AbstractPlatform
$platform
)
:
string
{
return
$platform
->
getClobTypeDeclarationSQL
(
$fieldDeclaration
);
}
...
...
@@ -60,7 +60,7 @@ class ArrayType extends Type
/**
* {@inheritdoc}
*/
public
function
getName
()
public
function
getName
()
:
string
{
return
Types
::
ARRAY
;
}
...
...
@@ -68,7 +68,7 @@ class ArrayType extends Type
/**
* {@inheritdoc}
*/
public
function
requiresSQLCommentHint
(
AbstractPlatform
$platform
)
public
function
requiresSQLCommentHint
(
AbstractPlatform
$platform
)
:
bool
{
return
true
;
}
...
...
lib/Doctrine/DBAL/Types/BigIntType.php
View file @
ab8d709f
...
...
@@ -15,7 +15,7 @@ class BigIntType extends Type implements PhpIntegerMappingType
/**
* {@inheritdoc}
*/
public
function
getName
()
public
function
getName
()
:
string
{
return
Types
::
BIGINT
;
}
...
...
@@ -23,7 +23,7 @@ class BigIntType extends Type implements PhpIntegerMappingType
/**
* {@inheritdoc}
*/
public
function
getSQLDeclaration
(
array
$fieldDeclaration
,
AbstractPlatform
$platform
)
public
function
getSQLDeclaration
(
array
$fieldDeclaration
,
AbstractPlatform
$platform
)
:
string
{
return
$platform
->
getBigIntTypeDeclarationSQL
(
$fieldDeclaration
);
}
...
...
@@ -31,7 +31,7 @@ class BigIntType extends Type implements PhpIntegerMappingType
/**
* {@inheritdoc}
*/
public
function
getBindingType
()
public
function
getBindingType
()
:
int
{
return
ParameterType
::
STRING
;
}
...
...
lib/Doctrine/DBAL/Types/BinaryType.php
View file @
ab8d709f
...
...
@@ -19,7 +19,7 @@ class BinaryType extends Type
/**
* {@inheritdoc}
*/
public
function
getSQLDeclaration
(
array
$fieldDeclaration
,
AbstractPlatform
$platform
)
public
function
getSQLDeclaration
(
array
$fieldDeclaration
,
AbstractPlatform
$platform
)
:
string
{
return
$platform
->
getBinaryTypeDeclarationSQL
(
$fieldDeclaration
);
}
...
...
@@ -47,7 +47,7 @@ class BinaryType extends Type
/**
* {@inheritdoc}
*/
public
function
getName
()
public
function
getName
()
:
string
{
return
Types
::
BINARY
;
}
...
...
@@ -55,7 +55,7 @@ class BinaryType extends Type
/**
* {@inheritdoc}
*/
public
function
getBindingType
()
public
function
getBindingType
()
:
int
{
return
ParameterType
::
BINARY
;
}
...
...
lib/Doctrine/DBAL/Types/BlobType.php
View file @
ab8d709f
...
...
@@ -22,7 +22,7 @@ class BlobType extends Type
/**
* {@inheritdoc}
*/
public
function
getSQLDeclaration
(
array
$fieldDeclaration
,
AbstractPlatform
$platform
)
public
function
getSQLDeclaration
(
array
$fieldDeclaration
,
AbstractPlatform
$platform
)
:
string
{
return
$platform
->
getBlobTypeDeclarationSQL
(
$fieldDeclaration
);
}
...
...
@@ -54,7 +54,7 @@ class BlobType extends Type
/**
* {@inheritdoc}
*/
public
function
getName
()
public
function
getName
()
:
string
{
return
Types
::
BLOB
;
}
...
...
@@ -62,7 +62,7 @@ class BlobType extends Type
/**
* {@inheritdoc}
*/
public
function
getBindingType
()
public
function
getBindingType
()
:
int
{
return
ParameterType
::
LARGE_OBJECT
;
}
...
...
lib/Doctrine/DBAL/Types/BooleanType.php
View file @
ab8d709f
...
...
@@ -15,7 +15,7 @@ class BooleanType extends Type
/**
* {@inheritdoc}
*/
public
function
getSQLDeclaration
(
array
$fieldDeclaration
,
AbstractPlatform
$platform
)
public
function
getSQLDeclaration
(
array
$fieldDeclaration
,
AbstractPlatform
$platform
)
:
string
{
return
$platform
->
getBooleanTypeDeclarationSQL
(
$fieldDeclaration
);
}
...
...
@@ -39,7 +39,7 @@ class BooleanType extends Type
/**
* {@inheritdoc}
*/
public
function
getName
()
public
function
getName
()
:
string
{
return
Types
::
BOOLEAN
;
}
...
...
@@ -47,7 +47,7 @@ class BooleanType extends Type
/**
* {@inheritdoc}
*/
public
function
getBindingType
()
public
function
getBindingType
()
:
int
{
return
ParameterType
::
BOOLEAN
;
}
...
...
lib/Doctrine/DBAL/Types/DateImmutableType.php
View file @
ab8d709f
...
...
@@ -17,7 +17,7 @@ class DateImmutableType extends DateType
/**
* {@inheritdoc}
*/
public
function
getName
()
public
function
getName
()
:
string
{
return
Types
::
DATE_IMMUTABLE
;
}
...
...
@@ -67,7 +67,7 @@ class DateImmutableType extends DateType
/**
* {@inheritdoc}
*/
public
function
requiresSQLCommentHint
(
AbstractPlatform
$platform
)
public
function
requiresSQLCommentHint
(
AbstractPlatform
$platform
)
:
bool
{
return
true
;
}
...
...
lib/Doctrine/DBAL/Types/DateIntervalType.php
View file @
ab8d709f
...
...
@@ -21,7 +21,7 @@ class DateIntervalType extends Type
/**
* {@inheritdoc}
*/
public
function
getName
()
public
function
getName
()
:
string
{
return
Types
::
DATEINTERVAL
;
}
...
...
@@ -29,7 +29,7 @@ class DateIntervalType extends Type
/**
* {@inheritdoc}
*/
public
function
getSQLDeclaration
(
array
$fieldDeclaration
,
AbstractPlatform
$platform
)
public
function
getSQLDeclaration
(
array
$fieldDeclaration
,
AbstractPlatform
$platform
)
:
string
{
$fieldDeclaration
[
'length'
]
=
255
;
...
...
@@ -84,7 +84,7 @@ class DateIntervalType extends Type
/**
* {@inheritdoc}
*/
public
function
requiresSQLCommentHint
(
AbstractPlatform
$platform
)
public
function
requiresSQLCommentHint
(
AbstractPlatform
$platform
)
:
bool
{
return
true
;
}
...
...
lib/Doctrine/DBAL/Types/DateTimeImmutableType.php
View file @
ab8d709f
...
...
@@ -18,7 +18,7 @@ class DateTimeImmutableType extends DateTimeType
/**
* {@inheritdoc}
*/
public
function
getName
()
public
function
getName
()
:
string
{
return
Types
::
DATETIME_IMMUTABLE
;
}
...
...
@@ -72,7 +72,7 @@ class DateTimeImmutableType extends DateTimeType
/**
* {@inheritdoc}
*/
public
function
requiresSQLCommentHint
(
AbstractPlatform
$platform
)
public
function
requiresSQLCommentHint
(
AbstractPlatform
$platform
)
:
bool
{
return
true
;
}
...
...
lib/Doctrine/DBAL/Types/DateTimeType.php
View file @
ab8d709f
...
...
@@ -19,7 +19,7 @@ class DateTimeType extends Type implements PhpDateTimeMappingType
/**
* {@inheritdoc}
*/
public
function
getName
()
public
function
getName
()
:
string
{
return
Types
::
DATETIME_MUTABLE
;
}
...
...
@@ -27,7 +27,7 @@ class DateTimeType extends Type implements PhpDateTimeMappingType
/**
* {@inheritdoc}
*/
public
function
getSQLDeclaration
(
array
$fieldDeclaration
,
AbstractPlatform
$platform
)
public
function
getSQLDeclaration
(
array
$fieldDeclaration
,
AbstractPlatform
$platform
)
:
string
{
return
$platform
->
getDateTimeTypeDeclarationSQL
(
$fieldDeclaration
);
}
...
...
lib/Doctrine/DBAL/Types/DateTimeTzImmutableType.php
View file @
ab8d709f
...
...
@@ -17,7 +17,7 @@ class DateTimeTzImmutableType extends DateTimeTzType
/**
* {@inheritdoc}
*/
public
function
getName
()
public
function
getName
()
:
string
{
return
Types
::
DATETIMETZ_IMMUTABLE
;
}
...
...
@@ -67,7 +67,7 @@ class DateTimeTzImmutableType extends DateTimeTzType
/**
* {@inheritdoc}
*/
public
function
requiresSQLCommentHint
(
AbstractPlatform
$platform
)
public
function
requiresSQLCommentHint
(
AbstractPlatform
$platform
)
:
bool
{
return
true
;
}
...
...
lib/Doctrine/DBAL/Types/DateTimeTzType.php
View file @
ab8d709f
...
...
@@ -31,7 +31,7 @@ class DateTimeTzType extends Type implements PhpDateTimeMappingType
/**
* {@inheritdoc}
*/
public
function
getName
()
public
function
getName
()
:
string
{
return
Types
::
DATETIMETZ_MUTABLE
;
}
...
...
@@ -39,7 +39,7 @@ class DateTimeTzType extends Type implements PhpDateTimeMappingType
/**
* {@inheritdoc}
*/
public
function
getSQLDeclaration
(
array
$fieldDeclaration
,
AbstractPlatform
$platform
)
public
function
getSQLDeclaration
(
array
$fieldDeclaration
,
AbstractPlatform
$platform
)
:
string
{
return
$platform
->
getDateTimeTzTypeDeclarationSQL
(
$fieldDeclaration
);
}
...
...
lib/Doctrine/DBAL/Types/DateType.php
View file @
ab8d709f
...
...
@@ -18,7 +18,7 @@ class DateType extends Type
/**
* {@inheritdoc}
*/
public
function
getName
()
public
function
getName
()
:
string
{
return
Types
::
DATE_MUTABLE
;
}
...
...
@@ -26,7 +26,7 @@ class DateType extends Type
/**
* {@inheritdoc}
*/
public
function
getSQLDeclaration
(
array
$fieldDeclaration
,
AbstractPlatform
$platform
)
public
function
getSQLDeclaration
(
array
$fieldDeclaration
,
AbstractPlatform
$platform
)
:
string
{
return
$platform
->
getDateTypeDeclarationSQL
(
$fieldDeclaration
);
}
...
...
lib/Doctrine/DBAL/Types/DecimalType.php
View file @
ab8d709f
...
...
@@ -14,7 +14,7 @@ class DecimalType extends Type
/**
* {@inheritdoc}
*/
public
function
getName
()
public
function
getName
()
:
string
{
return
Types
::
DECIMAL
;
}
...
...
@@ -22,7 +22,7 @@ class DecimalType extends Type
/**
* {@inheritdoc}
*/
public
function
getSQLDeclaration
(
array
$fieldDeclaration
,
AbstractPlatform
$platform
)
public
function
getSQLDeclaration
(
array
$fieldDeclaration
,
AbstractPlatform
$platform
)
:
string
{
return
$platform
->
getDecimalTypeDeclarationSQL
(
$fieldDeclaration
);
}
...
...
lib/Doctrine/DBAL/Types/Exception/ValueNotConvertible.php
View file @
ab8d709f
...
...
@@ -15,7 +15,10 @@ use function substr;
*/
final
class
ValueNotConvertible
extends
ConversionException
implements
TypesException
{
public
static
function
new
(
$value
,
$toType
,
?
string
$message
=
null
)
:
self
/**
* @param mixed $value
*/
public
static
function
new
(
$value
,
string
$toType
,
?
string
$message
=
null
)
:
self
{
if
(
$message
!==
null
)
{
return
new
self
(
...
...
lib/Doctrine/DBAL/Types/FloatType.php
View file @
ab8d709f
...
...
@@ -11,7 +11,7 @@ class FloatType extends Type
/**
* {@inheritdoc}
*/
public
function
getName
()
public
function
getName
()
:
string
{
return
Types
::
FLOAT
;
}
...
...
@@ -19,7 +19,7 @@ class FloatType extends Type
/**
* {@inheritdoc}
*/
public
function
getSQLDeclaration
(
array
$fieldDeclaration
,
AbstractPlatform
$platform
)
public
function
getSQLDeclaration
(
array
$fieldDeclaration
,
AbstractPlatform
$platform
)
:
string
{
return
$platform
->
getFloatDeclarationSQL
(
$fieldDeclaration
);
}
...
...
lib/Doctrine/DBAL/Types/GuidType.php
View file @
ab8d709f
...
...
@@ -14,7 +14,7 @@ class GuidType extends StringType
/**
* {@inheritdoc}
*/
public
function
getSQLDeclaration
(
array
$fieldDeclaration
,
AbstractPlatform
$platform
)
public
function
getSQLDeclaration
(
array
$fieldDeclaration
,
AbstractPlatform
$platform
)
:
string
{
return
$platform
->
getGuidTypeDeclarationSQL
(
$fieldDeclaration
);
}
...
...
@@ -22,7 +22,7 @@ class GuidType extends StringType
/**
* {@inheritdoc}
*/
public
function
getName
()
public
function
getName
()
:
string
{
return
Types
::
GUID
;
}
...
...
@@ -30,7 +30,7 @@ class GuidType extends StringType
/**
* {@inheritdoc}
*/
public
function
requiresSQLCommentHint
(
AbstractPlatform
$platform
)
public
function
requiresSQLCommentHint
(
AbstractPlatform
$platform
)
:
bool
{
return
!
$platform
->
hasNativeGuidType
();
}
...
...
lib/Doctrine/DBAL/Types/IntegerType.php
View file @
ab8d709f
...
...
@@ -15,7 +15,7 @@ class IntegerType extends Type implements PhpIntegerMappingType
/**
* {@inheritdoc}
*/
public
function
getName
()
public
function
getName
()
:
string
{
return
Types
::
INTEGER
;
}
...
...
@@ -23,7 +23,7 @@ class IntegerType extends Type implements PhpIntegerMappingType
/**
* {@inheritdoc}
*/
public
function
getSQLDeclaration
(
array
$fieldDeclaration
,
AbstractPlatform
$platform
)
public
function
getSQLDeclaration
(
array
$fieldDeclaration
,
AbstractPlatform
$platform
)
:
string
{
return
$platform
->
getIntegerTypeDeclarationSQL
(
$fieldDeclaration
);
}
...
...
@@ -39,7 +39,7 @@ class IntegerType extends Type implements PhpIntegerMappingType
/**
* {@inheritdoc}
*/
public
function
getBindingType
()
public
function
getBindingType
()
:
int
{
return
ParameterType
::
INTEGER
;
}
...
...
lib/Doctrine/DBAL/Types/JsonType.php
View file @
ab8d709f
...
...
@@ -23,7 +23,7 @@ class JsonType extends Type
/**
* {@inheritdoc}
*/
public
function
getSQLDeclaration
(
array
$fieldDeclaration
,
AbstractPlatform
$platform
)
public
function
getSQLDeclaration
(
array
$fieldDeclaration
,
AbstractPlatform
$platform
)
:
string
{
return
$platform
->
getJsonTypeDeclarationSQL
(
$fieldDeclaration
);
}
...
...
@@ -71,7 +71,7 @@ class JsonType extends Type
/**
* {@inheritdoc}
*/
public
function
getName
()
public
function
getName
()
:
string
{
return
Types
::
JSON
;
}
...
...
@@ -79,7 +79,7 @@ class JsonType extends Type
/**
* {@inheritdoc}
*/
public
function
requiresSQLCommentHint
(
AbstractPlatform
$platform
)
public
function
requiresSQLCommentHint
(
AbstractPlatform
$platform
)
:
bool
{
return
!
$platform
->
hasNativeJsonType
();
}
...
...
lib/Doctrine/DBAL/Types/ObjectType.php
View file @
ab8d709f
...
...
@@ -21,7 +21,7 @@ class ObjectType extends Type
/**
* {@inheritdoc}
*/
public
function
getSQLDeclaration
(
array
$fieldDeclaration
,
AbstractPlatform
$platform
)
public
function
getSQLDeclaration
(
array
$fieldDeclaration
,
AbstractPlatform
$platform
)
:
string
{
return
$platform
->
getClobTypeDeclarationSQL
(
$fieldDeclaration
);
}
...
...
@@ -59,7 +59,7 @@ class ObjectType extends Type
/**
* {@inheritdoc}
*/
public
function
getName
()
public
function
getName
()
:
string
{
return
Types
::
OBJECT
;
}
...
...
@@ -67,7 +67,7 @@ class ObjectType extends Type
/**
* {@inheritdoc}
*/
public
function
requiresSQLCommentHint
(
AbstractPlatform
$platform
)
public
function
requiresSQLCommentHint
(
AbstractPlatform
$platform
)
:
bool
{
return
true
;
}
...
...
lib/Doctrine/DBAL/Types/SimpleArrayType.php
View file @
ab8d709f
...
...
@@ -20,7 +20,7 @@ class SimpleArrayType extends Type
/**
* {@inheritdoc}
*/
public
function
getSQLDeclaration
(
array
$fieldDeclaration
,
AbstractPlatform
$platform
)
public
function
getSQLDeclaration
(
array
$fieldDeclaration
,
AbstractPlatform
$platform
)
:
string
{
return
$platform
->
getClobTypeDeclarationSQL
(
$fieldDeclaration
);
}
...
...
@@ -54,7 +54,7 @@ class SimpleArrayType extends Type
/**
* {@inheritdoc}
*/
public
function
getName
()
public
function
getName
()
:
string
{
return
Types
::
SIMPLE_ARRAY
;
}
...
...
@@ -62,7 +62,7 @@ class SimpleArrayType extends Type
/**
* {@inheritdoc}
*/
public
function
requiresSQLCommentHint
(
AbstractPlatform
$platform
)
public
function
requiresSQLCommentHint
(
AbstractPlatform
$platform
)
:
bool
{
return
true
;
}
...
...
lib/Doctrine/DBAL/Types/SmallIntType.php
View file @
ab8d709f
...
...
@@ -15,7 +15,7 @@ class SmallIntType extends Type implements PhpIntegerMappingType
/**
* {@inheritdoc}
*/
public
function
getName
()
public
function
getName
()
:
string
{
return
Types
::
SMALLINT
;
}
...
...
@@ -23,7 +23,7 @@ class SmallIntType extends Type implements PhpIntegerMappingType
/**
* {@inheritdoc}
*/
public
function
getSQLDeclaration
(
array
$fieldDeclaration
,
AbstractPlatform
$platform
)
public
function
getSQLDeclaration
(
array
$fieldDeclaration
,
AbstractPlatform
$platform
)
:
string
{
return
$platform
->
getSmallIntTypeDeclarationSQL
(
$fieldDeclaration
);
}
...
...
@@ -39,7 +39,7 @@ class SmallIntType extends Type implements PhpIntegerMappingType
/**
* {@inheritdoc}
*/
public
function
getBindingType
()
public
function
getBindingType
()
:
int
{
return
ParameterType
::
INTEGER
;
}
...
...
lib/Doctrine/DBAL/Types/StringType.php
View file @
ab8d709f
...
...
@@ -14,7 +14,7 @@ class StringType extends Type
/**
* {@inheritdoc}
*/
public
function
getSQLDeclaration
(
array
$fieldDeclaration
,
AbstractPlatform
$platform
)
public
function
getSQLDeclaration
(
array
$fieldDeclaration
,
AbstractPlatform
$platform
)
:
string
{
return
$platform
->
getVarcharTypeDeclarationSQL
(
$fieldDeclaration
);
}
...
...
@@ -22,7 +22,7 @@ class StringType extends Type
/**
* {@inheritdoc}
*/
public
function
getName
()
public
function
getName
()
:
string
{
return
Types
::
STRING
;
}
...
...
lib/Doctrine/DBAL/Types/TextType.php
View file @
ab8d709f
...
...
@@ -16,7 +16,7 @@ class TextType extends Type
/**
* {@inheritdoc}
*/
public
function
getSQLDeclaration
(
array
$fieldDeclaration
,
AbstractPlatform
$platform
)
public
function
getSQLDeclaration
(
array
$fieldDeclaration
,
AbstractPlatform
$platform
)
:
string
{
return
$platform
->
getClobTypeDeclarationSQL
(
$fieldDeclaration
);
}
...
...
@@ -32,7 +32,7 @@ class TextType extends Type
/**
* {@inheritdoc}
*/
public
function
getName
()
public
function
getName
()
:
string
{
return
Types
::
TEXT
;
}
...
...
lib/Doctrine/DBAL/Types/TimeImmutableType.php
View file @
ab8d709f
...
...
@@ -17,7 +17,7 @@ class TimeImmutableType extends TimeType
/**
* {@inheritdoc}
*/
public
function
getName
()
public
function
getName
()
:
string
{
return
Types
::
TIME_IMMUTABLE
;
}
...
...
@@ -67,7 +67,7 @@ class TimeImmutableType extends TimeType
/**
* {@inheritdoc}
*/
public
function
requiresSQLCommentHint
(
AbstractPlatform
$platform
)
public
function
requiresSQLCommentHint
(
AbstractPlatform
$platform
)
:
bool
{
return
true
;
}
...
...
lib/Doctrine/DBAL/Types/TimeType.php
View file @
ab8d709f
...
...
@@ -18,7 +18,7 @@ class TimeType extends Type
/**
* {@inheritdoc}
*/
public
function
getName
()
public
function
getName
()
:
string
{
return
Types
::
TIME_MUTABLE
;
}
...
...
@@ -26,7 +26,7 @@ class TimeType extends Type
/**
* {@inheritdoc}
*/
public
function
getSQLDeclaration
(
array
$fieldDeclaration
,
AbstractPlatform
$platform
)
public
function
getSQLDeclaration
(
array
$fieldDeclaration
,
AbstractPlatform
$platform
)
:
string
{
return
$platform
->
getTimeTypeDeclarationSQL
(
$fieldDeclaration
);
}
...
...
lib/Doctrine/DBAL/Types/Type.php
View file @
ab8d709f
...
...
@@ -160,21 +160,17 @@ abstract class Type
/**
* Gets the SQL declaration snippet for a field of this type.
*
* @param mixed[] $fieldDeclaration The field declaration.
* @param AbstractPlatform $platform The currently used database platform.
*
* @return string
* @param array<string, mixed> $fieldDeclaration The field declaration.
* @param AbstractPlatform $platform The currently used database platform.
*/
abstract
public
function
getSQLDeclaration
(
array
$fieldDeclaration
,
AbstractPlatform
$platform
);
abstract
public
function
getSQLDeclaration
(
array
$fieldDeclaration
,
AbstractPlatform
$platform
)
:
string
;
/**
* Gets the name of this type.
*
* @return string
*
* @todo Needed?
*/
abstract
public
function
getName
();
abstract
public
function
getName
()
:
string
;
/**
* @internal This method is only to be used within DBAL for forward compatibility purposes. Do not use directly.
...
...
@@ -205,11 +201,9 @@ abstract class Type
*
* @param string $name The name of the type (as returned by getName()).
*
* @return \Doctrine\DBAL\Types\Type
*
* @throws DBALException
*/
public
static
function
getType
(
$name
)
public
static
function
getType
(
string
$name
)
:
self
{
return
self
::
getTypeRegistry
()
->
get
(
$name
);
}
...
...
@@ -220,11 +214,9 @@ abstract class Type
* @param string $name The name of the type. This should correspond to what getName() returns.
* @param string $className The class name of the custom type.
*
* @return void
*
* @throws DBALException
*/
public
static
function
addType
(
$name
,
$className
)
public
static
function
addType
(
string
$name
,
string
$className
)
:
void
{
self
::
getTypeRegistry
()
->
register
(
$name
,
new
$className
());
}
...
...
@@ -236,7 +228,7 @@ abstract class Type
*
* @return bool TRUE if type is supported; FALSE otherwise.
*/
public
static
function
hasType
(
$name
)
public
static
function
hasType
(
string
$name
)
:
bool
{
return
self
::
getTypeRegistry
()
->
has
(
$name
);
}
...
...
@@ -244,14 +236,9 @@ abstract class Type
/**
* Overrides an already defined type to use a different implementation.
*
* @param string $name
* @param string $className
*
* @return void
*
* @throws DBALException
*/
public
static
function
overrideType
(
$name
,
$className
)
public
static
function
overrideType
(
string
$name
,
string
$className
)
:
void
{
self
::
getTypeRegistry
()
->
override
(
$name
,
new
$className
());
}
...
...
@@ -261,10 +248,8 @@ abstract class Type
* can be used when binding parameters to prepared statements.
*
* This method should return one of the {@link \Doctrine\DBAL\ParameterType} constants.
*
* @return int
*/
public
function
getBindingType
()
public
function
getBindingType
()
:
int
{
return
ParameterType
::
STRING
;
}
...
...
@@ -273,9 +258,9 @@ abstract class Type
* Gets the types array map which holds all registered types and the corresponding
* type class
*
* @return
string[]
* @return
array<string, string>
*/
public
static
function
getTypesMap
()
public
static
function
getTypesMap
()
:
array
{
return
array_map
(
static
function
(
Type
$type
)
:
string
{
...
...
@@ -292,35 +277,24 @@ abstract class Type
* Usage of {@link convertToDatabaseValueSQL} and
* {@link convertToPHPValueSQL} works for any type and mostly
* does nothing. This method can additionally be used for optimization purposes.
*
* @return bool
*/
public
function
canRequireSQLConversion
()
public
function
canRequireSQLConversion
()
:
bool
{
return
false
;
}
/**
* Modifies the SQL expression (identifier, parameter) to convert to a database value.
*
* @param string $sqlExpr
*
* @return string
*/
public
function
convertToDatabaseValueSQL
(
$sqlExpr
,
AbstractPlatform
$platform
)
public
function
convertToDatabaseValueSQL
(
string
$sqlExpr
,
AbstractPlatform
$platform
)
:
string
{
return
$sqlExpr
;
}
/**
* Modifies the SQL expression (identifier, parameter) to convert to a PHP value.
*
* @param string $sqlExpr
* @param AbstractPlatform $platform
*
* @return string
*/
public
function
convertToPHPValueSQL
(
$sqlExpr
,
$platform
)
public
function
convertToPHPValueSQL
(
string
$sqlExpr
,
AbstractPlatform
$platform
)
:
string
{
return
$sqlExpr
;
}
...
...
@@ -328,9 +302,9 @@ abstract class Type
/**
* Gets an array of database types that map to this Doctrine type.
*
* @return
string[]
* @return
array<int, string>
*/
public
function
getMappedDatabaseTypes
(
AbstractPlatform
$platform
)
public
function
getMappedDatabaseTypes
(
AbstractPlatform
$platform
)
:
array
{
return
[];
}
...
...
@@ -340,10 +314,8 @@ abstract class Type
* reverse schema engineering can't tell them apart. You need to mark
* one of those types as commented, which will have Doctrine use an SQL
* comment to typehint the actual Doctrine Type.
*
* @return bool
*/
public
function
requiresSQLCommentHint
(
AbstractPlatform
$platform
)
public
function
requiresSQLCommentHint
(
AbstractPlatform
$platform
)
:
bool
{
return
false
;
}
...
...
lib/Doctrine/DBAL/Types/TypeRegistry.php
View file @
ab8d709f
...
...
@@ -21,7 +21,11 @@ use function in_array;
*/
final
class
TypeRegistry
{
/** @var array<string, Type> Map of type names and their corresponding flyweight objects. */
/**
* Map of type names and their corresponding flyweight objects.
*
* @var array<string, Type>
*/
private
$instances
=
[];
/**
...
...
lib/Doctrine/DBAL/Types/VarDateTimeImmutableType.php
View file @
ab8d709f
...
...
@@ -18,7 +18,7 @@ class VarDateTimeImmutableType extends VarDateTimeType
/**
* {@inheritdoc}
*/
public
function
getName
()
public
function
getName
()
:
string
{
return
Types
::
DATETIME_IMMUTABLE
;
}
...
...
@@ -64,7 +64,7 @@ class VarDateTimeImmutableType extends VarDateTimeType
/**
* {@inheritdoc}
*/
public
function
requiresSQLCommentHint
(
AbstractPlatform
$platform
)
public
function
requiresSQLCommentHint
(
AbstractPlatform
$platform
)
:
bool
{
return
true
;
}
...
...
tests/Doctrine/Tests/DBAL/Functional/Schema/PostgreSqlSchemaManagerTest.php
View file @
ab8d709f
...
...
@@ -525,7 +525,7 @@ class MoneyType extends Type
/**
* {@inheritDoc}
*/
public
function
getName
()
public
function
getName
()
:
string
{
return
'MyMoney'
;
}
...
...
@@ -533,7 +533,7 @@ class MoneyType extends Type
/**
* {@inheritDoc}
*/
public
function
getSQLDeclaration
(
array
$fieldDeclaration
,
AbstractPlatform
$platform
)
public
function
getSQLDeclaration
(
array
$fieldDeclaration
,
AbstractPlatform
$platform
)
:
string
{
return
'MyMoney'
;
}
...
...
tests/Doctrine/Tests/Types/CommentedType.php
View file @
ab8d709f
...
...
@@ -13,7 +13,7 @@ class CommentedType extends Type
/**
* {@inheritDoc}
*/
public
function
getName
()
public
function
getName
()
:
string
{
return
'my_commented'
;
}
...
...
@@ -21,7 +21,7 @@ class CommentedType extends Type
/**
* {@inheritDoc}
*/
public
function
getSQLDeclaration
(
array
$fieldDeclaration
,
AbstractPlatform
$platform
)
public
function
getSQLDeclaration
(
array
$fieldDeclaration
,
AbstractPlatform
$platform
)
:
string
{
return
strtoupper
(
$this
->
getName
());
}
...
...
@@ -29,7 +29,7 @@ class CommentedType extends Type
/**
* {@inheritDoc}
*/
public
function
requiresSQLCommentHint
(
AbstractPlatform
$platform
)
public
function
requiresSQLCommentHint
(
AbstractPlatform
$platform
)
:
bool
{
return
true
;
}
...
...
tests/Doctrine/Tests/Types/MySqlPointType.php
View file @
ab8d709f
...
...
@@ -13,7 +13,7 @@ class MySqlPointType extends Type
/**
* {@inheritDoc}
*/
public
function
getName
()
public
function
getName
()
:
string
{
return
'point'
;
}
...
...
@@ -21,7 +21,7 @@ class MySqlPointType extends Type
/**
* {@inheritDoc}
*/
public
function
getSQLDeclaration
(
array
$fieldDeclaration
,
AbstractPlatform
$platform
)
public
function
getSQLDeclaration
(
array
$fieldDeclaration
,
AbstractPlatform
$platform
)
:
string
{
return
strtoupper
(
$this
->
getName
());
}
...
...
@@ -29,7 +29,7 @@ class MySqlPointType extends Type
/**
* {@inheritDoc}
*/
public
function
getMappedDatabaseTypes
(
AbstractPlatform
$platform
)
public
function
getMappedDatabaseTypes
(
AbstractPlatform
$platform
)
:
array
{
return
[
'point'
];
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment