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
80f42dc7
Commit
80f42dc7
authored
Jul 25, 2017
by
Alessandro Minoccheri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed array short declarations
parent
5cefa4d9
Changes
87
Show whitespace changes
Inline
Side-by-side
Showing
87 changed files
with
504 additions
and
503 deletions
+504
-503
ArrayStatement.php
lib/Doctrine/DBAL/Cache/ArrayStatement.php
+1
-1
ResultCacheStatement.php
lib/Doctrine/DBAL/Cache/ResultCacheStatement.php
+3
-3
Configuration.php
lib/Doctrine/DBAL/Configuration.php
+1
-1
Connection.php
lib/Doctrine/DBAL/Connection.php
+22
-22
MasterSlaveConnection.php
lib/Doctrine/DBAL/Connections/MasterSlaveConnection.php
+1
-1
DBALException.php
lib/Doctrine/DBAL/DBALException.php
+1
-1
Driver.php
lib/Doctrine/DBAL/Driver.php
+1
-1
DriverManager.php
lib/Doctrine/DBAL/DriverManager.php
+5
-5
MysqlSessionInit.php
lib/Doctrine/DBAL/Event/Listeners/MysqlSessionInit.php
+1
-1
OracleSessionInit.php
lib/Doctrine/DBAL/Event/Listeners/OracleSessionInit.php
+5
-5
SQLSessionInit.php
lib/Doctrine/DBAL/Event/Listeners/SQLSessionInit.php
+1
-1
SchemaAlterTableAddColumnEventArgs.php
...octrine/DBAL/Event/SchemaAlterTableAddColumnEventArgs.php
+1
-1
SchemaAlterTableChangeColumnEventArgs.php
...rine/DBAL/Event/SchemaAlterTableChangeColumnEventArgs.php
+1
-1
SchemaAlterTableEventArgs.php
lib/Doctrine/DBAL/Event/SchemaAlterTableEventArgs.php
+1
-1
SchemaAlterTableRemoveColumnEventArgs.php
...rine/DBAL/Event/SchemaAlterTableRemoveColumnEventArgs.php
+1
-1
SchemaAlterTableRenameColumnEventArgs.php
...rine/DBAL/Event/SchemaAlterTableRenameColumnEventArgs.php
+1
-1
SchemaCreateTableColumnEventArgs.php
lib/Doctrine/DBAL/Event/SchemaCreateTableColumnEventArgs.php
+1
-1
SchemaCreateTableEventArgs.php
lib/Doctrine/DBAL/Event/SchemaCreateTableEventArgs.php
+1
-1
TableGenerator.php
lib/Doctrine/DBAL/Id/TableGenerator.php
+6
-6
TableGeneratorSchemaVisitor.php
lib/Doctrine/DBAL/Id/TableGeneratorSchemaVisitor.php
+2
-2
DebugStack.php
lib/Doctrine/DBAL/Logging/DebugStack.php
+2
-2
LoggerChain.php
lib/Doctrine/DBAL/Logging/LoggerChain.php
+1
-1
AbstractPlatform.php
lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
+19
-19
DB2Platform.php
lib/Doctrine/DBAL/Platforms/DB2Platform.php
+15
-15
DrizzlePlatform.php
lib/Doctrine/DBAL/Platforms/DrizzlePlatform.php
+8
-8
DB2Keywords.php
lib/Doctrine/DBAL/Platforms/Keywords/DB2Keywords.php
+2
-2
DrizzleKeywords.php
lib/Doctrine/DBAL/Platforms/Keywords/DrizzleKeywords.php
+2
-2
MySQL57Keywords.php
lib/Doctrine/DBAL/Platforms/Keywords/MySQL57Keywords.php
+2
-2
MySQLKeywords.php
lib/Doctrine/DBAL/Platforms/Keywords/MySQLKeywords.php
+2
-2
OracleKeywords.php
lib/Doctrine/DBAL/Platforms/Keywords/OracleKeywords.php
+2
-2
PostgreSQL91Keywords.php
...Doctrine/DBAL/Platforms/Keywords/PostgreSQL91Keywords.php
+2
-2
PostgreSQL92Keywords.php
...Doctrine/DBAL/Platforms/Keywords/PostgreSQL92Keywords.php
+2
-2
PostgreSQL94Keywords.php
...Doctrine/DBAL/Platforms/Keywords/PostgreSQL94Keywords.php
+4
-4
PostgreSQLKeywords.php
lib/Doctrine/DBAL/Platforms/Keywords/PostgreSQLKeywords.php
+2
-2
ReservedKeywordsValidator.php
...ine/DBAL/Platforms/Keywords/ReservedKeywordsValidator.php
+3
-3
SQLAnywhere11Keywords.php
...octrine/DBAL/Platforms/Keywords/SQLAnywhere11Keywords.php
+3
-3
SQLAnywhere12Keywords.php
...octrine/DBAL/Platforms/Keywords/SQLAnywhere12Keywords.php
+4
-4
SQLAnywhere16Keywords.php
...octrine/DBAL/Platforms/Keywords/SQLAnywhere16Keywords.php
+2
-2
SQLAnywhereKeywords.php
lib/Doctrine/DBAL/Platforms/Keywords/SQLAnywhereKeywords.php
+2
-2
SQLServer2005Keywords.php
...octrine/DBAL/Platforms/Keywords/SQLServer2005Keywords.php
+2
-2
SQLServer2008Keywords.php
...octrine/DBAL/Platforms/Keywords/SQLServer2008Keywords.php
+2
-2
SQLServer2012Keywords.php
...octrine/DBAL/Platforms/Keywords/SQLServer2012Keywords.php
+2
-2
SQLServerKeywords.php
lib/Doctrine/DBAL/Platforms/Keywords/SQLServerKeywords.php
+2
-2
SQLiteKeywords.php
lib/Doctrine/DBAL/Platforms/Keywords/SQLiteKeywords.php
+2
-2
MySQL57Platform.php
lib/Doctrine/DBAL/Platforms/MySQL57Platform.php
+4
-4
MySqlPlatform.php
lib/Doctrine/DBAL/Platforms/MySqlPlatform.php
+18
-18
OraclePlatform.php
lib/Doctrine/DBAL/Platforms/OraclePlatform.php
+18
-18
PostgreSqlPlatform.php
lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php
+16
-16
SQLAnywherePlatform.php
lib/Doctrine/DBAL/Platforms/SQLAnywherePlatform.php
+12
-12
SQLServer2012Platform.php
lib/Doctrine/DBAL/Platforms/SQLServer2012Platform.php
+1
-1
SQLServerPlatform.php
lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php
+15
-15
SqlitePlatform.php
lib/Doctrine/DBAL/Platforms/SqlitePlatform.php
+20
-20
Connection.php
lib/Doctrine/DBAL/Portability/Connection.php
+1
-1
Statement.php
lib/Doctrine/DBAL/Portability/Statement.php
+1
-1
QueryBuilder.php
lib/Doctrine/DBAL/Query/QueryBuilder.php
+4
-4
SQLParserUtils.php
lib/Doctrine/DBAL/SQLParserUtils.php
+9
-9
AbstractAsset.php
lib/Doctrine/DBAL/Schema/AbstractAsset.php
+1
-1
AbstractSchemaManager.php
lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php
+24
-24
Column.php
lib/Doctrine/DBAL/Schema/Column.php
+5
-5
ColumnDiff.php
lib/Doctrine/DBAL/Schema/ColumnDiff.php
+2
-2
Comparator.php
lib/Doctrine/DBAL/Schema/Comparator.php
+8
-8
DB2SchemaManager.php
lib/Doctrine/DBAL/Schema/DB2SchemaManager.php
+11
-11
DrizzleSchemaManager.php
lib/Doctrine/DBAL/Schema/DrizzleSchemaManager.php
+7
-7
ForeignKeyConstraint.php
lib/Doctrine/DBAL/Schema/ForeignKeyConstraint.php
+8
-8
Index.php
lib/Doctrine/DBAL/Schema/Index.php
+6
-6
MySqlSchemaManager.php
lib/Doctrine/DBAL/Schema/MySqlSchemaManager.php
+14
-14
OracleSchemaManager.php
lib/Doctrine/DBAL/Schema/OracleSchemaManager.php
+14
-14
PostgreSqlSchemaManager.php
lib/Doctrine/DBAL/Schema/PostgreSqlSchemaManager.php
+13
-13
SQLAnywhereSchemaManager.php
lib/Doctrine/DBAL/Schema/SQLAnywhereSchemaManager.php
+12
-11
SQLServerSchemaManager.php
lib/Doctrine/DBAL/Schema/SQLServerSchemaManager.php
+13
-13
Schema.php
lib/Doctrine/DBAL/Schema/Schema.php
+6
-6
SchemaConfig.php
lib/Doctrine/DBAL/Schema/SchemaConfig.php
+1
-1
SchemaDiff.php
lib/Doctrine/DBAL/Schema/SchemaDiff.php
+12
-12
SqliteSchemaManager.php
lib/Doctrine/DBAL/Schema/SqliteSchemaManager.php
+19
-19
Table.php
lib/Doctrine/DBAL/Schema/Table.php
+18
-18
TableDiff.php
lib/Doctrine/DBAL/Schema/TableDiff.php
+13
-13
CreateSchemaSqlCollector.php
...Doctrine/DBAL/Schema/Visitor/CreateSchemaSqlCollector.php
+8
-8
DropSchemaSqlCollector.php
lib/Doctrine/DBAL/Schema/Visitor/DropSchemaSqlCollector.php
+1
-1
Graphviz.php
lib/Doctrine/DBAL/Schema/Visitor/Graphviz.php
+4
-4
SQLAzureFederationsSynchronizer.php
...BAL/Sharding/SQLAzure/SQLAzureFederationsSynchronizer.php
+2
-2
MultiTenantVisitor.php
...rine/DBAL/Sharding/SQLAzure/Schema/MultiTenantVisitor.php
+1
-1
Statement.php
lib/Doctrine/DBAL/Statement.php
+4
-4
ImportCommand.php
lib/Doctrine/DBAL/Tools/Console/Command/ImportCommand.php
+2
-2
ReservedWordsCommand.php
...trine/DBAL/Tools/Console/Command/ReservedWordsCommand.php
+4
-4
JsonArrayType.php
lib/Doctrine/DBAL/Types/JsonArrayType.php
+1
-1
SimpleArrayType.php
lib/Doctrine/DBAL/Types/SimpleArrayType.php
+1
-1
Type.php
lib/Doctrine/DBAL/Types/Type.php
+4
-4
No files found.
lib/Doctrine/DBAL/Cache/ArrayStatement.php
View file @
80f42dc7
...
@@ -124,7 +124,7 @@ class ArrayStatement implements \IteratorAggregate, ResultStatement
...
@@ -124,7 +124,7 @@ class ArrayStatement implements \IteratorAggregate, ResultStatement
*/
*/
public
function
fetchAll
(
$fetchMode
=
null
,
$fetchArgument
=
null
,
$ctorArgs
=
null
)
public
function
fetchAll
(
$fetchMode
=
null
,
$fetchArgument
=
null
,
$ctorArgs
=
null
)
{
{
$rows
=
array
()
;
$rows
=
[]
;
while
(
$row
=
$this
->
fetch
(
$fetchMode
))
{
while
(
$row
=
$this
->
fetch
(
$fetchMode
))
{
$rows
[]
=
$row
;
$rows
[]
=
$row
;
}
}
...
...
lib/Doctrine/DBAL/Cache/ResultCacheStatement.php
View file @
80f42dc7
...
@@ -107,7 +107,7 @@ class ResultCacheStatement implements \IteratorAggregate, ResultStatement
...
@@ -107,7 +107,7 @@ class ResultCacheStatement implements \IteratorAggregate, ResultStatement
if
(
$this
->
emptied
&&
$this
->
data
!==
null
)
{
if
(
$this
->
emptied
&&
$this
->
data
!==
null
)
{
$data
=
$this
->
resultCache
->
fetch
(
$this
->
cacheKey
);
$data
=
$this
->
resultCache
->
fetch
(
$this
->
cacheKey
);
if
(
!
$data
)
{
if
(
!
$data
)
{
$data
=
array
()
;
$data
=
[]
;
}
}
$data
[
$this
->
realKey
]
=
$this
->
data
;
$data
[
$this
->
realKey
]
=
$this
->
data
;
...
@@ -150,7 +150,7 @@ class ResultCacheStatement implements \IteratorAggregate, ResultStatement
...
@@ -150,7 +150,7 @@ class ResultCacheStatement implements \IteratorAggregate, ResultStatement
public
function
fetch
(
$fetchMode
=
null
,
$cursorOrientation
=
\PDO
::
FETCH_ORI_NEXT
,
$cursorOffset
=
0
)
public
function
fetch
(
$fetchMode
=
null
,
$cursorOrientation
=
\PDO
::
FETCH_ORI_NEXT
,
$cursorOffset
=
0
)
{
{
if
(
$this
->
data
===
null
)
{
if
(
$this
->
data
===
null
)
{
$this
->
data
=
array
()
;
$this
->
data
=
[]
;
}
}
$row
=
$this
->
statement
->
fetch
(
PDO
::
FETCH_ASSOC
);
$row
=
$this
->
statement
->
fetch
(
PDO
::
FETCH_ASSOC
);
...
@@ -181,7 +181,7 @@ class ResultCacheStatement implements \IteratorAggregate, ResultStatement
...
@@ -181,7 +181,7 @@ class ResultCacheStatement implements \IteratorAggregate, ResultStatement
*/
*/
public
function
fetchAll
(
$fetchMode
=
null
,
$fetchArgument
=
null
,
$ctorArgs
=
null
)
public
function
fetchAll
(
$fetchMode
=
null
,
$fetchArgument
=
null
,
$ctorArgs
=
null
)
{
{
$rows
=
array
()
;
$rows
=
[]
;
while
(
$row
=
$this
->
fetch
(
$fetchMode
))
{
while
(
$row
=
$this
->
fetch
(
$fetchMode
))
{
$rows
[]
=
$row
;
$rows
[]
=
$row
;
}
}
...
...
lib/Doctrine/DBAL/Configuration.php
View file @
80f42dc7
...
@@ -40,7 +40,7 @@ class Configuration
...
@@ -40,7 +40,7 @@ class Configuration
*
*
* @var array
* @var array
*/
*/
protected
$_attributes
=
array
()
;
protected
$_attributes
=
[]
;
/**
/**
* Sets the SQL logger to use. Defaults to NULL which means SQL logging is disabled.
* Sets the SQL logger to use. Defaults to NULL which means SQL logging is disabled.
...
...
lib/Doctrine/DBAL/Connection.php
View file @
80f42dc7
...
@@ -153,7 +153,7 @@ class Connection implements DriverConnection
...
@@ -153,7 +153,7 @@ class Connection implements DriverConnection
*
*
* @var array
* @var array
*/
*/
private
$_params
=
array
()
;
private
$_params
=
[]
;
/**
/**
* The DatabasePlatform object that provides information about the
* The DatabasePlatform object that provides information about the
...
@@ -355,7 +355,7 @@ class Connection implements DriverConnection
...
@@ -355,7 +355,7 @@ class Connection implements DriverConnection
}
}
$driverOptions
=
isset
(
$this
->
_params
[
'driverOptions'
])
?
$driverOptions
=
isset
(
$this
->
_params
[
'driverOptions'
])
?
$this
->
_params
[
'driverOptions'
]
:
array
()
;
$this
->
_params
[
'driverOptions'
]
:
[]
;
$user
=
isset
(
$this
->
_params
[
'user'
])
?
$this
->
_params
[
'user'
]
:
null
;
$user
=
isset
(
$this
->
_params
[
'user'
])
?
$this
->
_params
[
'user'
]
:
null
;
$password
=
isset
(
$this
->
_params
[
'password'
])
?
$password
=
isset
(
$this
->
_params
[
'password'
])
?
$this
->
_params
[
'password'
]
:
null
;
$this
->
_params
[
'password'
]
:
null
;
...
@@ -546,7 +546,7 @@ class Connection implements DriverConnection
...
@@ -546,7 +546,7 @@ class Connection implements DriverConnection
*
*
* @return array|bool False is returned if no rows are found.
* @return array|bool False is returned if no rows are found.
*/
*/
public
function
fetchAssoc
(
$statement
,
array
$params
=
array
(),
array
$types
=
array
()
)
public
function
fetchAssoc
(
$statement
,
array
$params
=
[],
array
$types
=
[]
)
{
{
return
$this
->
executeQuery
(
$statement
,
$params
,
$types
)
->
fetch
(
PDO
::
FETCH_ASSOC
);
return
$this
->
executeQuery
(
$statement
,
$params
,
$types
)
->
fetch
(
PDO
::
FETCH_ASSOC
);
}
}
...
@@ -561,7 +561,7 @@ class Connection implements DriverConnection
...
@@ -561,7 +561,7 @@ class Connection implements DriverConnection
*
*
* @return array|bool False is returned if no rows are found.
* @return array|bool False is returned if no rows are found.
*/
*/
public
function
fetchArray
(
$statement
,
array
$params
=
array
(),
array
$types
=
array
()
)
public
function
fetchArray
(
$statement
,
array
$params
=
[],
array
$types
=
[]
)
{
{
return
$this
->
executeQuery
(
$statement
,
$params
,
$types
)
->
fetch
(
PDO
::
FETCH_NUM
);
return
$this
->
executeQuery
(
$statement
,
$params
,
$types
)
->
fetch
(
PDO
::
FETCH_NUM
);
}
}
...
@@ -577,7 +577,7 @@ class Connection implements DriverConnection
...
@@ -577,7 +577,7 @@ class Connection implements DriverConnection
*
*
* @return mixed|bool False is returned if no rows are found.
* @return mixed|bool False is returned if no rows are found.
*/
*/
public
function
fetchColumn
(
$statement
,
array
$params
=
array
(),
$column
=
0
,
array
$types
=
array
()
)
public
function
fetchColumn
(
$statement
,
array
$params
=
[],
$column
=
0
,
array
$types
=
[]
)
{
{
return
$this
->
executeQuery
(
$statement
,
$params
,
$types
)
->
fetchColumn
(
$column
);
return
$this
->
executeQuery
(
$statement
,
$params
,
$types
)
->
fetchColumn
(
$column
);
}
}
...
@@ -645,7 +645,7 @@ class Connection implements DriverConnection
...
@@ -645,7 +645,7 @@ class Connection implements DriverConnection
*
*
* @throws InvalidArgumentException
* @throws InvalidArgumentException
*/
*/
public
function
delete
(
$tableExpression
,
array
$identifier
,
array
$types
=
array
()
)
public
function
delete
(
$tableExpression
,
array
$identifier
,
array
$types
=
[]
)
{
{
if
(
empty
(
$identifier
))
{
if
(
empty
(
$identifier
))
{
throw
InvalidArgumentException
::
fromEmptyCriteria
();
throw
InvalidArgumentException
::
fromEmptyCriteria
();
...
@@ -712,11 +712,11 @@ class Connection implements DriverConnection
...
@@ -712,11 +712,11 @@ class Connection implements DriverConnection
*
*
* @return integer The number of affected rows.
* @return integer The number of affected rows.
*/
*/
public
function
update
(
$tableExpression
,
array
$data
,
array
$identifier
,
array
$types
=
array
()
)
public
function
update
(
$tableExpression
,
array
$data
,
array
$identifier
,
array
$types
=
[]
)
{
{
$setColumns
=
array
()
;
$setColumns
=
[]
;
$setValues
=
array
()
;
$setValues
=
[]
;
$set
=
array
()
;
$set
=
[]
;
foreach
(
$data
as
$columnName
=>
$value
)
{
foreach
(
$data
as
$columnName
=>
$value
)
{
$setColumns
[]
=
$columnName
;
$setColumns
[]
=
$columnName
;
...
@@ -749,15 +749,15 @@ class Connection implements DriverConnection
...
@@ -749,15 +749,15 @@ class Connection implements DriverConnection
*
*
* @return integer The number of affected rows.
* @return integer The number of affected rows.
*/
*/
public
function
insert
(
$tableExpression
,
array
$data
,
array
$types
=
array
()
)
public
function
insert
(
$tableExpression
,
array
$data
,
array
$types
=
[]
)
{
{
if
(
empty
(
$data
))
{
if
(
empty
(
$data
))
{
return
$this
->
executeUpdate
(
'INSERT INTO '
.
$tableExpression
.
' ()'
.
' VALUES ()'
);
return
$this
->
executeUpdate
(
'INSERT INTO '
.
$tableExpression
.
' ()'
.
' VALUES ()'
);
}
}
$columns
=
array
()
;
$columns
=
[]
;
$values
=
array
()
;
$values
=
[]
;
$set
=
array
()
;
$set
=
[]
;
foreach
(
$data
as
$columnName
=>
$value
)
{
foreach
(
$data
as
$columnName
=>
$value
)
{
$columns
[]
=
$columnName
;
$columns
[]
=
$columnName
;
...
@@ -783,7 +783,7 @@ class Connection implements DriverConnection
...
@@ -783,7 +783,7 @@ class Connection implements DriverConnection
*/
*/
private
function
extractTypeValues
(
array
$columnList
,
array
$types
)
private
function
extractTypeValues
(
array
$columnList
,
array
$types
)
{
{
$typeValues
=
array
()
;
$typeValues
=
[]
;
foreach
(
$columnList
as
$columnIndex
=>
$columnName
)
{
foreach
(
$columnList
as
$columnIndex
=>
$columnName
)
{
$typeValues
[]
=
isset
(
$types
[
$columnName
])
$typeValues
[]
=
isset
(
$types
[
$columnName
])
...
@@ -839,7 +839,7 @@ class Connection implements DriverConnection
...
@@ -839,7 +839,7 @@ class Connection implements DriverConnection
*
*
* @return array
* @return array
*/
*/
public
function
fetchAll
(
$sql
,
array
$params
=
array
(),
$types
=
array
()
)
public
function
fetchAll
(
$sql
,
array
$params
=
[],
$types
=
[]
)
{
{
return
$this
->
executeQuery
(
$sql
,
$params
,
$types
)
->
fetchAll
();
return
$this
->
executeQuery
(
$sql
,
$params
,
$types
)
->
fetchAll
();
}
}
...
@@ -881,7 +881,7 @@ class Connection implements DriverConnection
...
@@ -881,7 +881,7 @@ class Connection implements DriverConnection
*
*
* @throws \Doctrine\DBAL\DBALException
* @throws \Doctrine\DBAL\DBALException
*/
*/
public
function
executeQuery
(
$query
,
array
$params
=
array
(),
$types
=
array
()
,
QueryCacheProfile
$qcp
=
null
)
public
function
executeQuery
(
$query
,
array
$params
=
[],
$types
=
[]
,
QueryCacheProfile
$qcp
=
null
)
{
{
if
(
$qcp
!==
null
)
{
if
(
$qcp
!==
null
)
{
return
$this
->
executeCacheQuery
(
$query
,
$params
,
$types
,
$qcp
);
return
$this
->
executeCacheQuery
(
$query
,
$params
,
$types
,
$qcp
);
...
@@ -948,7 +948,7 @@ class Connection implements DriverConnection
...
@@ -948,7 +948,7 @@ class Connection implements DriverConnection
if
(
isset
(
$data
[
$realKey
]))
{
if
(
isset
(
$data
[
$realKey
]))
{
$stmt
=
new
ArrayStatement
(
$data
[
$realKey
]);
$stmt
=
new
ArrayStatement
(
$data
[
$realKey
]);
}
elseif
(
array_key_exists
(
$realKey
,
$data
))
{
}
elseif
(
array_key_exists
(
$realKey
,
$data
))
{
$stmt
=
new
ArrayStatement
(
array
()
);
$stmt
=
new
ArrayStatement
(
[]
);
}
}
}
}
...
@@ -975,7 +975,7 @@ class Connection implements DriverConnection
...
@@ -975,7 +975,7 @@ class Connection implements DriverConnection
*/
*/
public
function
project
(
$query
,
array
$params
,
Closure
$function
)
public
function
project
(
$query
,
array
$params
,
Closure
$function
)
{
{
$result
=
array
()
;
$result
=
[]
;
$stmt
=
$this
->
executeQuery
(
$query
,
$params
);
$stmt
=
$this
->
executeQuery
(
$query
,
$params
);
while
(
$row
=
$stmt
->
fetch
())
{
while
(
$row
=
$stmt
->
fetch
())
{
...
@@ -1034,7 +1034,7 @@ class Connection implements DriverConnection
...
@@ -1034,7 +1034,7 @@ class Connection implements DriverConnection
*
*
* @throws \Doctrine\DBAL\DBALException
* @throws \Doctrine\DBAL\DBALException
*/
*/
public
function
executeUpdate
(
$query
,
array
$params
=
array
(),
array
$types
=
array
()
)
public
function
executeUpdate
(
$query
,
array
$params
=
[],
array
$types
=
[]
)
{
{
$this
->
connect
();
$this
->
connect
();
...
@@ -1574,7 +1574,7 @@ class Connection implements DriverConnection
...
@@ -1574,7 +1574,7 @@ class Connection implements DriverConnection
$bindingType
=
$type
;
// PDO::PARAM_* constants
$bindingType
=
$type
;
// PDO::PARAM_* constants
}
}
return
array
(
$value
,
$bindingType
)
;
return
[
$value
,
$bindingType
]
;
}
}
/**
/**
...
@@ -1590,7 +1590,7 @@ class Connection implements DriverConnection
...
@@ -1590,7 +1590,7 @@ class Connection implements DriverConnection
*/
*/
public
function
resolveParams
(
array
$params
,
array
$types
)
public
function
resolveParams
(
array
$params
,
array
$types
)
{
{
$resolvedParams
=
array
()
;
$resolvedParams
=
[]
;
// Check whether parameters are positional or named. Mixing is not allowed, just like in PDO.
// Check whether parameters are positional or named. Mixing is not allowed, just like in PDO.
if
(
is_int
(
key
(
$params
)))
{
if
(
is_int
(
key
(
$params
)))
{
...
...
lib/Doctrine/DBAL/Connections/MasterSlaveConnection.php
View file @
80f42dc7
...
@@ -288,7 +288,7 @@ class MasterSlaveConnection extends Connection
...
@@ -288,7 +288,7 @@ class MasterSlaveConnection extends Connection
parent
::
close
();
parent
::
close
();
$this
->
_conn
=
null
;
$this
->
_conn
=
null
;
$this
->
connections
=
array
(
'master'
=>
null
,
'slave'
=>
null
)
;
$this
->
connections
=
[
'master'
=>
null
,
'slave'
=>
null
]
;
}
}
/**
/**
...
...
lib/Doctrine/DBAL/DBALException.php
View file @
80f42dc7
...
@@ -117,7 +117,7 @@ class DBALException extends \Exception
...
@@ -117,7 +117,7 @@ class DBALException extends \Exception
*
*
* @return \Doctrine\DBAL\DBALException
* @return \Doctrine\DBAL\DBALException
*/
*/
public
static
function
driverExceptionDuringQuery
(
Driver
$driver
,
\Exception
$driverEx
,
$sql
,
array
$params
=
array
()
)
public
static
function
driverExceptionDuringQuery
(
Driver
$driver
,
\Exception
$driverEx
,
$sql
,
array
$params
=
[]
)
{
{
$msg
=
"An exception occurred while executing '"
.
$sql
.
"'"
;
$msg
=
"An exception occurred while executing '"
.
$sql
.
"'"
;
if
(
$params
)
{
if
(
$params
)
{
...
...
lib/Doctrine/DBAL/Driver.php
View file @
80f42dc7
...
@@ -37,7 +37,7 @@ interface Driver
...
@@ -37,7 +37,7 @@ interface Driver
*
*
* @return \Doctrine\DBAL\Driver\Connection The database connection.
* @return \Doctrine\DBAL\Driver\Connection The database connection.
*/
*/
public
function
connect
(
array
$params
,
$username
=
null
,
$password
=
null
,
array
$driverOptions
=
array
()
);
public
function
connect
(
array
$params
,
$username
=
null
,
$password
=
null
,
array
$driverOptions
=
[]
);
/**
/**
* Gets the DatabasePlatform instance that provides all the metadata about
* Gets the DatabasePlatform instance that provides all the metadata about
...
...
lib/Doctrine/DBAL/DriverManager.php
View file @
80f42dc7
...
@@ -37,7 +37,7 @@ final class DriverManager
...
@@ -37,7 +37,7 @@ final class DriverManager
*
*
* @var array
* @var array
*/
*/
private
static
$_driverMap
=
array
(
private
static
$_driverMap
=
[
'pdo_mysql'
=>
'Doctrine\DBAL\Driver\PDOMySql\Driver'
,
'pdo_mysql'
=>
'Doctrine\DBAL\Driver\PDOMySql\Driver'
,
'pdo_sqlite'
=>
'Doctrine\DBAL\Driver\PDOSqlite\Driver'
,
'pdo_sqlite'
=>
'Doctrine\DBAL\Driver\PDOSqlite\Driver'
,
'pdo_pgsql'
=>
'Doctrine\DBAL\Driver\PDOPgSql\Driver'
,
'pdo_pgsql'
=>
'Doctrine\DBAL\Driver\PDOPgSql\Driver'
,
...
@@ -49,12 +49,12 @@ final class DriverManager
...
@@ -49,12 +49,12 @@ final class DriverManager
'drizzle_pdo_mysql'
=>
'Doctrine\DBAL\Driver\DrizzlePDOMySql\Driver'
,
'drizzle_pdo_mysql'
=>
'Doctrine\DBAL\Driver\DrizzlePDOMySql\Driver'
,
'sqlanywhere'
=>
'Doctrine\DBAL\Driver\SQLAnywhere\Driver'
,
'sqlanywhere'
=>
'Doctrine\DBAL\Driver\SQLAnywhere\Driver'
,
'sqlsrv'
=>
'Doctrine\DBAL\Driver\SQLSrv\Driver'
,
'sqlsrv'
=>
'Doctrine\DBAL\Driver\SQLSrv\Driver'
,
)
;
]
;
/**
/**
* List of URL schemes from a database URL and their mappings to driver.
* List of URL schemes from a database URL and their mappings to driver.
*/
*/
private
static
$driverSchemeAliases
=
array
(
private
static
$driverSchemeAliases
=
[
'db2'
=>
'ibm_db2'
,
'db2'
=>
'ibm_db2'
,
'mssql'
=>
'pdo_sqlsrv'
,
'mssql'
=>
'pdo_sqlsrv'
,
'mysql'
=>
'pdo_mysql'
,
'mysql'
=>
'pdo_mysql'
,
...
@@ -64,7 +64,7 @@ final class DriverManager
...
@@ -64,7 +64,7 @@ final class DriverManager
'pgsql'
=>
'pdo_pgsql'
,
'pgsql'
=>
'pdo_pgsql'
,
'sqlite'
=>
'pdo_sqlite'
,
'sqlite'
=>
'pdo_sqlite'
,
'sqlite3'
=>
'pdo_sqlite'
,
'sqlite3'
=>
'pdo_sqlite'
,
)
;
]
;
/**
/**
* Private constructor. This class cannot be instantiated.
* Private constructor. This class cannot be instantiated.
...
@@ -334,7 +334,7 @@ final class DriverManager
...
@@ -334,7 +334,7 @@ final class DriverManager
return
$params
;
return
$params
;
}
}
$query
=
array
()
;
$query
=
[]
;
parse_str
(
$url
[
'query'
],
$query
);
// simply ingest query as extra params, e.g. charset or sslmode
parse_str
(
$url
[
'query'
],
$query
);
// simply ingest query as extra params, e.g. charset or sslmode
...
...
lib/Doctrine/DBAL/Event/Listeners/MysqlSessionInit.php
View file @
80f42dc7
...
@@ -75,6 +75,6 @@ class MysqlSessionInit implements EventSubscriber
...
@@ -75,6 +75,6 @@ class MysqlSessionInit implements EventSubscriber
*/
*/
public
function
getSubscribedEvents
()
public
function
getSubscribedEvents
()
{
{
return
array
(
Events
::
postConnect
)
;
return
[
Events
::
postConnect
]
;
}
}
}
}
lib/Doctrine/DBAL/Event/Listeners/OracleSessionInit.php
View file @
80f42dc7
...
@@ -42,18 +42,18 @@ class OracleSessionInit implements EventSubscriber
...
@@ -42,18 +42,18 @@ class OracleSessionInit implements EventSubscriber
/**
/**
* @var array
* @var array
*/
*/
protected
$_defaultSessionVars
=
array
(
protected
$_defaultSessionVars
=
[
'NLS_TIME_FORMAT'
=>
"HH24:MI:SS"
,
'NLS_TIME_FORMAT'
=>
"HH24:MI:SS"
,
'NLS_DATE_FORMAT'
=>
"YYYY-MM-DD HH24:MI:SS"
,
'NLS_DATE_FORMAT'
=>
"YYYY-MM-DD HH24:MI:SS"
,
'NLS_TIMESTAMP_FORMAT'
=>
"YYYY-MM-DD HH24:MI:SS"
,
'NLS_TIMESTAMP_FORMAT'
=>
"YYYY-MM-DD HH24:MI:SS"
,
'NLS_TIMESTAMP_TZ_FORMAT'
=>
"YYYY-MM-DD HH24:MI:SS TZH:TZM"
,
'NLS_TIMESTAMP_TZ_FORMAT'
=>
"YYYY-MM-DD HH24:MI:SS TZH:TZM"
,
'NLS_NUMERIC_CHARACTERS'
=>
".,"
,
'NLS_NUMERIC_CHARACTERS'
=>
".,"
,
)
;
]
;
/**
/**
* @param array $oracleSessionVars
* @param array $oracleSessionVars
*/
*/
public
function
__construct
(
array
$oracleSessionVars
=
array
()
)
public
function
__construct
(
array
$oracleSessionVars
=
[]
)
{
{
$this
->
_defaultSessionVars
=
array_merge
(
$this
->
_defaultSessionVars
,
$oracleSessionVars
);
$this
->
_defaultSessionVars
=
array_merge
(
$this
->
_defaultSessionVars
,
$oracleSessionVars
);
}
}
...
@@ -67,7 +67,7 @@ class OracleSessionInit implements EventSubscriber
...
@@ -67,7 +67,7 @@ class OracleSessionInit implements EventSubscriber
{
{
if
(
count
(
$this
->
_defaultSessionVars
))
{
if
(
count
(
$this
->
_defaultSessionVars
))
{
array_change_key_case
(
$this
->
_defaultSessionVars
,
\CASE_UPPER
);
array_change_key_case
(
$this
->
_defaultSessionVars
,
\CASE_UPPER
);
$vars
=
array
()
;
$vars
=
[]
;
foreach
(
$this
->
_defaultSessionVars
as
$option
=>
$value
)
{
foreach
(
$this
->
_defaultSessionVars
as
$option
=>
$value
)
{
if
(
$option
===
'CURRENT_SCHEMA'
)
{
if
(
$option
===
'CURRENT_SCHEMA'
)
{
$vars
[]
=
$option
.
" = "
.
$value
;
$vars
[]
=
$option
.
" = "
.
$value
;
...
@@ -85,6 +85,6 @@ class OracleSessionInit implements EventSubscriber
...
@@ -85,6 +85,6 @@ class OracleSessionInit implements EventSubscriber
*/
*/
public
function
getSubscribedEvents
()
public
function
getSubscribedEvents
()
{
{
return
array
(
Events
::
postConnect
)
;
return
[
Events
::
postConnect
]
;
}
}
}
}
lib/Doctrine/DBAL/Event/Listeners/SQLSessionInit.php
View file @
80f42dc7
...
@@ -61,6 +61,6 @@ class SQLSessionInit implements EventSubscriber
...
@@ -61,6 +61,6 @@ class SQLSessionInit implements EventSubscriber
*/
*/
public
function
getSubscribedEvents
()
public
function
getSubscribedEvents
()
{
{
return
array
(
Events
::
postConnect
)
;
return
[
Events
::
postConnect
]
;
}
}
}
}
lib/Doctrine/DBAL/Event/SchemaAlterTableAddColumnEventArgs.php
View file @
80f42dc7
...
@@ -50,7 +50,7 @@ class SchemaAlterTableAddColumnEventArgs extends SchemaEventArgs
...
@@ -50,7 +50,7 @@ class SchemaAlterTableAddColumnEventArgs extends SchemaEventArgs
/**
/**
* @var array
* @var array
*/
*/
private
$_sql
=
array
()
;
private
$_sql
=
[]
;
/**
/**
* @param \Doctrine\DBAL\Schema\Column $column
* @param \Doctrine\DBAL\Schema\Column $column
...
...
lib/Doctrine/DBAL/Event/SchemaAlterTableChangeColumnEventArgs.php
View file @
80f42dc7
...
@@ -50,7 +50,7 @@ class SchemaAlterTableChangeColumnEventArgs extends SchemaEventArgs
...
@@ -50,7 +50,7 @@ class SchemaAlterTableChangeColumnEventArgs extends SchemaEventArgs
/**
/**
* @var array
* @var array
*/
*/
private
$_sql
=
array
()
;
private
$_sql
=
[]
;
/**
/**
* @param \Doctrine\DBAL\Schema\ColumnDiff $columnDiff
* @param \Doctrine\DBAL\Schema\ColumnDiff $columnDiff
...
...
lib/Doctrine/DBAL/Event/SchemaAlterTableEventArgs.php
View file @
80f42dc7
...
@@ -44,7 +44,7 @@ class SchemaAlterTableEventArgs extends SchemaEventArgs
...
@@ -44,7 +44,7 @@ class SchemaAlterTableEventArgs extends SchemaEventArgs
/**
/**
* @var array
* @var array
*/
*/
private
$_sql
=
array
()
;
private
$_sql
=
[]
;
/**
/**
* @param \Doctrine\DBAL\Schema\TableDiff $tableDiff
* @param \Doctrine\DBAL\Schema\TableDiff $tableDiff
...
...
lib/Doctrine/DBAL/Event/SchemaAlterTableRemoveColumnEventArgs.php
View file @
80f42dc7
...
@@ -50,7 +50,7 @@ class SchemaAlterTableRemoveColumnEventArgs extends SchemaEventArgs
...
@@ -50,7 +50,7 @@ class SchemaAlterTableRemoveColumnEventArgs extends SchemaEventArgs
/**
/**
* @var array
* @var array
*/
*/
private
$_sql
=
array
()
;
private
$_sql
=
[]
;
/**
/**
* @param \Doctrine\DBAL\Schema\Column $column
* @param \Doctrine\DBAL\Schema\Column $column
...
...
lib/Doctrine/DBAL/Event/SchemaAlterTableRenameColumnEventArgs.php
View file @
80f42dc7
...
@@ -55,7 +55,7 @@ class SchemaAlterTableRenameColumnEventArgs extends SchemaEventArgs
...
@@ -55,7 +55,7 @@ class SchemaAlterTableRenameColumnEventArgs extends SchemaEventArgs
/**
/**
* @var array
* @var array
*/
*/
private
$_sql
=
array
()
;
private
$_sql
=
[]
;
/**
/**
* @param string $oldColumnName
* @param string $oldColumnName
...
...
lib/Doctrine/DBAL/Event/SchemaCreateTableColumnEventArgs.php
View file @
80f42dc7
...
@@ -50,7 +50,7 @@ class SchemaCreateTableColumnEventArgs extends SchemaEventArgs
...
@@ -50,7 +50,7 @@ class SchemaCreateTableColumnEventArgs extends SchemaEventArgs
/**
/**
* @var array
* @var array
*/
*/
private
$_sql
=
array
()
;
private
$_sql
=
[]
;
/**
/**
* @param \Doctrine\DBAL\Schema\Column $column
* @param \Doctrine\DBAL\Schema\Column $column
...
...
lib/Doctrine/DBAL/Event/SchemaCreateTableEventArgs.php
View file @
80f42dc7
...
@@ -54,7 +54,7 @@ class SchemaCreateTableEventArgs extends SchemaEventArgs
...
@@ -54,7 +54,7 @@ class SchemaCreateTableEventArgs extends SchemaEventArgs
/**
/**
* @var array
* @var array
*/
*/
private
$_sql
=
array
()
;
private
$_sql
=
[]
;
/**
/**
* @param \Doctrine\DBAL\Schema\Table $table
* @param \Doctrine\DBAL\Schema\Table $table
...
...
lib/Doctrine/DBAL/Id/TableGenerator.php
View file @
80f42dc7
...
@@ -76,7 +76,7 @@ class TableGenerator
...
@@ -76,7 +76,7 @@ class TableGenerator
/**
/**
* @var array
* @var array
*/
*/
private
$sequences
=
array
()
;
private
$sequences
=
[]
;
/**
/**
* @param \Doctrine\DBAL\Connection $conn
* @param \Doctrine\DBAL\Connection $conn
...
@@ -122,7 +122,7 @@ class TableGenerator
...
@@ -122,7 +122,7 @@ class TableGenerator
$sql
=
"SELECT sequence_value, sequence_increment_by "
.
$sql
=
"SELECT sequence_value, sequence_increment_by "
.
"FROM "
.
$platform
->
appendLockHint
(
$this
->
generatorTableName
,
\Doctrine\DBAL\LockMode
::
PESSIMISTIC_WRITE
)
.
" "
.
"FROM "
.
$platform
->
appendLockHint
(
$this
->
generatorTableName
,
\Doctrine\DBAL\LockMode
::
PESSIMISTIC_WRITE
)
.
" "
.
"WHERE sequence_name = ? "
.
$platform
->
getWriteLockSQL
();
"WHERE sequence_name = ? "
.
$platform
->
getWriteLockSQL
();
$stmt
=
$this
->
conn
->
executeQuery
(
$sql
,
array
(
$sequenceName
)
);
$stmt
=
$this
->
conn
->
executeQuery
(
$sql
,
[
$sequenceName
]
);
if
(
$row
=
$stmt
->
fetch
(
\PDO
::
FETCH_ASSOC
))
{
if
(
$row
=
$stmt
->
fetch
(
\PDO
::
FETCH_ASSOC
))
{
$row
=
array_change_key_case
(
$row
,
CASE_LOWER
);
$row
=
array_change_key_case
(
$row
,
CASE_LOWER
);
...
@@ -131,16 +131,16 @@ class TableGenerator
...
@@ -131,16 +131,16 @@ class TableGenerator
$value
++
;
$value
++
;
if
(
$row
[
'sequence_increment_by'
]
>
1
)
{
if
(
$row
[
'sequence_increment_by'
]
>
1
)
{
$this
->
sequences
[
$sequenceName
]
=
array
(
$this
->
sequences
[
$sequenceName
]
=
[
'value'
=>
$value
,
'value'
=>
$value
,
'max'
=>
$row
[
'sequence_value'
]
+
$row
[
'sequence_increment_by'
]
'max'
=>
$row
[
'sequence_value'
]
+
$row
[
'sequence_increment_by'
]
)
;
]
;
}
}
$sql
=
"UPDATE "
.
$this
->
generatorTableName
.
" "
.
$sql
=
"UPDATE "
.
$this
->
generatorTableName
.
" "
.
"SET sequence_value = sequence_value + sequence_increment_by "
.
"SET sequence_value = sequence_value + sequence_increment_by "
.
"WHERE sequence_name = ? AND sequence_value = ?"
;
"WHERE sequence_name = ? AND sequence_value = ?"
;
$rows
=
$this
->
conn
->
executeUpdate
(
$sql
,
array
(
$sequenceName
,
$row
[
'sequence_value'
])
);
$rows
=
$this
->
conn
->
executeUpdate
(
$sql
,
[
$sequenceName
,
$row
[
'sequence_value'
]]
);
if
(
$rows
!=
1
)
{
if
(
$rows
!=
1
)
{
throw
new
\Doctrine\DBAL\DBALException
(
"Race-condition detected while updating sequence. Aborting generation"
);
throw
new
\Doctrine\DBAL\DBALException
(
"Race-condition detected while updating sequence. Aborting generation"
);
...
@@ -148,7 +148,7 @@ class TableGenerator
...
@@ -148,7 +148,7 @@ class TableGenerator
}
else
{
}
else
{
$this
->
conn
->
insert
(
$this
->
conn
->
insert
(
$this
->
generatorTableName
,
$this
->
generatorTableName
,
array
(
'sequence_name'
=>
$sequenceName
,
'sequence_value'
=>
1
,
'sequence_increment_by'
=>
1
)
[
'sequence_name'
=>
$sequenceName
,
'sequence_value'
=>
1
,
'sequence_increment_by'
=>
1
]
);
);
$value
=
1
;
$value
=
1
;
}
}
...
...
lib/Doctrine/DBAL/Id/TableGeneratorSchemaVisitor.php
View file @
80f42dc7
...
@@ -48,8 +48,8 @@ class TableGeneratorSchemaVisitor implements \Doctrine\DBAL\Schema\Visitor\Visit
...
@@ -48,8 +48,8 @@ class TableGeneratorSchemaVisitor implements \Doctrine\DBAL\Schema\Visitor\Visit
{
{
$table
=
$schema
->
createTable
(
$this
->
generatorTableName
);
$table
=
$schema
->
createTable
(
$this
->
generatorTableName
);
$table
->
addColumn
(
'sequence_name'
,
'string'
);
$table
->
addColumn
(
'sequence_name'
,
'string'
);
$table
->
addColumn
(
'sequence_value'
,
'integer'
,
array
(
'default'
=>
1
)
);
$table
->
addColumn
(
'sequence_value'
,
'integer'
,
[
'default'
=>
1
]
);
$table
->
addColumn
(
'sequence_increment_by'
,
'integer'
,
array
(
'default'
=>
1
)
);
$table
->
addColumn
(
'sequence_increment_by'
,
'integer'
,
[
'default'
=>
1
]
);
}
}
/**
/**
...
...
lib/Doctrine/DBAL/Logging/DebugStack.php
View file @
80f42dc7
...
@@ -36,7 +36,7 @@ class DebugStack implements SQLLogger
...
@@ -36,7 +36,7 @@ class DebugStack implements SQLLogger
*
*
* @var array
* @var array
*/
*/
public
$queries
=
array
()
;
public
$queries
=
[]
;
/**
/**
* If Debug Stack is enabled (log queries) or not.
* If Debug Stack is enabled (log queries) or not.
...
@@ -62,7 +62,7 @@ class DebugStack implements SQLLogger
...
@@ -62,7 +62,7 @@ class DebugStack implements SQLLogger
{
{
if
(
$this
->
enabled
)
{
if
(
$this
->
enabled
)
{
$this
->
start
=
microtime
(
true
);
$this
->
start
=
microtime
(
true
);
$this
->
queries
[
++
$this
->
currentQuery
]
=
array
(
'sql'
=>
$sql
,
'params'
=>
$params
,
'types'
=>
$types
,
'executionMS'
=>
0
)
;
$this
->
queries
[
++
$this
->
currentQuery
]
=
[
'sql'
=>
$sql
,
'params'
=>
$params
,
'types'
=>
$types
,
'executionMS'
=>
0
]
;
}
}
}
}
...
...
lib/Doctrine/DBAL/Logging/LoggerChain.php
View file @
80f42dc7
...
@@ -31,7 +31,7 @@ class LoggerChain implements SQLLogger
...
@@ -31,7 +31,7 @@ class LoggerChain implements SQLLogger
/**
/**
* @var \Doctrine\DBAL\Logging\SQLLogger[]
* @var \Doctrine\DBAL\Logging\SQLLogger[]
*/
*/
private
$loggers
=
array
()
;
private
$loggers
=
[]
;
/**
/**
* Adds a logger in the chain.
* Adds a logger in the chain.
...
...
lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
View file @
80f42dc7
...
@@ -457,7 +457,7 @@ abstract class AbstractPlatform
...
@@ -457,7 +457,7 @@ abstract class AbstractPlatform
*/
*/
protected
function
initializeCommentedDoctrineTypes
()
protected
function
initializeCommentedDoctrineTypes
()
{
{
$this
->
doctrineTypeComments
=
array
()
;
$this
->
doctrineTypeComments
=
[]
;
foreach
(
Type
::
getTypesMap
()
as
$typeName
=>
$className
)
{
foreach
(
Type
::
getTypesMap
()
as
$typeName
=>
$className
)
{
$type
=
Type
::
getType
(
$typeName
);
$type
=
Type
::
getType
(
$typeName
);
...
@@ -607,7 +607,7 @@ abstract class AbstractPlatform
...
@@ -607,7 +607,7 @@ abstract class AbstractPlatform
*/
*/
public
function
getWildcards
()
public
function
getWildcards
()
{
{
return
array
(
'%'
,
'_'
)
;
return
[
'%'
,
'_'
]
;
}
}
/**
/**
...
@@ -1518,9 +1518,9 @@ abstract class AbstractPlatform
...
@@ -1518,9 +1518,9 @@ abstract class AbstractPlatform
$tableName
=
$table
->
getQuotedName
(
$this
);
$tableName
=
$table
->
getQuotedName
(
$this
);
$options
=
$table
->
getOptions
();
$options
=
$table
->
getOptions
();
$options
[
'uniqueConstraints'
]
=
array
()
;
$options
[
'uniqueConstraints'
]
=
[]
;
$options
[
'indexes'
]
=
array
()
;
$options
[
'indexes'
]
=
[]
;
$options
[
'primary'
]
=
array
()
;
$options
[
'primary'
]
=
[]
;
if
((
$createFlags
&
self
::
CREATE_INDEXES
)
>
0
)
{
if
((
$createFlags
&
self
::
CREATE_INDEXES
)
>
0
)
{
foreach
(
$table
->
getIndexes
()
as
$index
)
{
foreach
(
$table
->
getIndexes
()
as
$index
)
{
...
@@ -1534,8 +1534,8 @@ abstract class AbstractPlatform
...
@@ -1534,8 +1534,8 @@ abstract class AbstractPlatform
}
}
}
}
$columnSql
=
array
()
;
$columnSql
=
[]
;
$columns
=
array
()
;
$columns
=
[]
;
foreach
(
$table
->
getColumns
()
as
$column
)
{
foreach
(
$table
->
getColumns
()
as
$column
)
{
/* @var \Doctrine\DBAL\Schema\Column $column */
/* @var \Doctrine\DBAL\Schema\Column $column */
...
@@ -1568,7 +1568,7 @@ abstract class AbstractPlatform
...
@@ -1568,7 +1568,7 @@ abstract class AbstractPlatform
}
}
if
((
$createFlags
&
self
::
CREATE_FOREIGNKEYS
)
>
0
)
{
if
((
$createFlags
&
self
::
CREATE_FOREIGNKEYS
)
>
0
)
{
$options
[
'foreignKeys'
]
=
array
()
;
$options
[
'foreignKeys'
]
=
[]
;
foreach
(
$table
->
getForeignKeys
()
as
$fkConstraint
)
{
foreach
(
$table
->
getForeignKeys
()
as
$fkConstraint
)
{
$options
[
'foreignKeys'
][]
=
$fkConstraint
;
$options
[
'foreignKeys'
][]
=
$fkConstraint
;
}
}
...
@@ -1641,7 +1641,7 @@ abstract class AbstractPlatform
...
@@ -1641,7 +1641,7 @@ abstract class AbstractPlatform
*
*
* @return array
* @return array
*/
*/
protected
function
_getCreateTableSQL
(
$tableName
,
array
$columns
,
array
$options
=
array
()
)
protected
function
_getCreateTableSQL
(
$tableName
,
array
$columns
,
array
$options
=
[]
)
{
{
$columnListSql
=
$this
->
getColumnDeclarationListSQL
(
$columns
);
$columnListSql
=
$this
->
getColumnDeclarationListSQL
(
$columns
);
...
@@ -1860,7 +1860,7 @@ abstract class AbstractPlatform
...
@@ -1860,7 +1860,7 @@ abstract class AbstractPlatform
public
function
quoteIdentifier
(
$str
)
public
function
quoteIdentifier
(
$str
)
{
{
if
(
strpos
(
$str
,
"."
)
!==
false
)
{
if
(
strpos
(
$str
,
"."
)
!==
false
)
{
$parts
=
array_map
(
array
(
$this
,
"quoteSingleIdentifier"
)
,
explode
(
"."
,
$str
));
$parts
=
array_map
(
[
$this
,
"quoteSingleIdentifier"
]
,
explode
(
"."
,
$str
));
return
implode
(
"."
,
$parts
);
return
implode
(
"."
,
$parts
);
}
}
...
@@ -2051,7 +2051,7 @@ abstract class AbstractPlatform
...
@@ -2051,7 +2051,7 @@ abstract class AbstractPlatform
{
{
$tableName
=
$diff
->
getName
(
$this
)
->
getQuotedName
(
$this
);
$tableName
=
$diff
->
getName
(
$this
)
->
getQuotedName
(
$this
);
$sql
=
array
()
;
$sql
=
[]
;
if
(
$this
->
supportsForeignKeyConstraints
())
{
if
(
$this
->
supportsForeignKeyConstraints
())
{
foreach
(
$diff
->
removedForeignKeys
as
$foreignKey
)
{
foreach
(
$diff
->
removedForeignKeys
as
$foreignKey
)
{
$sql
[]
=
$this
->
getDropForeignKeySQL
(
$foreignKey
,
$tableName
);
$sql
[]
=
$this
->
getDropForeignKeySQL
(
$foreignKey
,
$tableName
);
...
@@ -2082,7 +2082,7 @@ abstract class AbstractPlatform
...
@@ -2082,7 +2082,7 @@ abstract class AbstractPlatform
?
$diff
->
getNewName
()
->
getQuotedName
(
$this
)
?
$diff
->
getNewName
()
->
getQuotedName
(
$this
)
:
$diff
->
getName
(
$this
)
->
getQuotedName
(
$this
);
:
$diff
->
getName
(
$this
)
->
getQuotedName
(
$this
);
$sql
=
array
()
;
$sql
=
[]
;
if
(
$this
->
supportsForeignKeyConstraints
())
{
if
(
$this
->
supportsForeignKeyConstraints
())
{
foreach
(
$diff
->
addedForeignKeys
as
$foreignKey
)
{
foreach
(
$diff
->
addedForeignKeys
as
$foreignKey
)
{
...
@@ -2124,10 +2124,10 @@ abstract class AbstractPlatform
...
@@ -2124,10 +2124,10 @@ abstract class AbstractPlatform
*/
*/
protected
function
getRenameIndexSQL
(
$oldIndexName
,
Index
$index
,
$tableName
)
protected
function
getRenameIndexSQL
(
$oldIndexName
,
Index
$index
,
$tableName
)
{
{
return
array
(
return
[
$this
->
getDropIndexSQL
(
$oldIndexName
,
$tableName
),
$this
->
getDropIndexSQL
(
$oldIndexName
,
$tableName
),
$this
->
getCreateIndexSQL
(
$index
,
$tableName
)
$this
->
getCreateIndexSQL
(
$index
,
$tableName
)
)
;
]
;
}
}
/**
/**
...
@@ -2173,7 +2173,7 @@ abstract class AbstractPlatform
...
@@ -2173,7 +2173,7 @@ abstract class AbstractPlatform
*/
*/
public
function
getColumnDeclarationListSQL
(
array
$fields
)
public
function
getColumnDeclarationListSQL
(
array
$fields
)
{
{
$queryFields
=
array
()
;
$queryFields
=
[]
;
foreach
(
$fields
as
$fieldName
=>
$field
)
{
foreach
(
$fields
as
$fieldName
=>
$field
)
{
$queryFields
[]
=
$this
->
getColumnDeclarationSQL
(
$fieldName
,
$field
);
$queryFields
[]
=
$this
->
getColumnDeclarationSQL
(
$fieldName
,
$field
);
...
@@ -2279,9 +2279,9 @@ abstract class AbstractPlatform
...
@@ -2279,9 +2279,9 @@ abstract class AbstractPlatform
if
(
isset
(
$field
[
'default'
]))
{
if
(
isset
(
$field
[
'default'
]))
{
$default
=
" DEFAULT '"
.
$field
[
'default'
]
.
"'"
;
$default
=
" DEFAULT '"
.
$field
[
'default'
]
.
"'"
;
if
(
isset
(
$field
[
'type'
]))
{
if
(
isset
(
$field
[
'type'
]))
{
if
(
in_array
((
string
)
$field
[
'type'
],
array
(
"Integer"
,
"BigInt"
,
"SmallInt"
)
))
{
if
(
in_array
((
string
)
$field
[
'type'
],
[
"Integer"
,
"BigInt"
,
"SmallInt"
]
))
{
$default
=
" DEFAULT "
.
$field
[
'default'
];
$default
=
" DEFAULT "
.
$field
[
'default'
];
}
elseif
(
in_array
((
string
)
$field
[
'type'
],
array
(
'DateTime'
,
'DateTimeTz'
)
)
&&
$field
[
'default'
]
==
$this
->
getCurrentTimestampSQL
())
{
}
elseif
(
in_array
((
string
)
$field
[
'type'
],
[
'DateTime'
,
'DateTimeTz'
]
)
&&
$field
[
'default'
]
==
$this
->
getCurrentTimestampSQL
())
{
$default
=
" DEFAULT "
.
$this
->
getCurrentTimestampSQL
();
$default
=
" DEFAULT "
.
$this
->
getCurrentTimestampSQL
();
}
elseif
((
string
)
$field
[
'type'
]
==
'Time'
&&
$field
[
'default'
]
==
$this
->
getCurrentTimeSQL
())
{
}
elseif
((
string
)
$field
[
'type'
]
==
'Time'
&&
$field
[
'default'
]
==
$this
->
getCurrentTimeSQL
())
{
$default
=
" DEFAULT "
.
$this
->
getCurrentTimeSQL
();
$default
=
" DEFAULT "
.
$this
->
getCurrentTimeSQL
();
...
@@ -2306,7 +2306,7 @@ abstract class AbstractPlatform
...
@@ -2306,7 +2306,7 @@ abstract class AbstractPlatform
*/
*/
public
function
getCheckDeclarationSQL
(
array
$definition
)
public
function
getCheckDeclarationSQL
(
array
$definition
)
{
{
$constraints
=
array
()
;
$constraints
=
[]
;
foreach
(
$definition
as
$field
=>
$def
)
{
foreach
(
$definition
as
$field
=>
$def
)
{
if
(
is_string
(
$def
))
{
if
(
is_string
(
$def
))
{
$constraints
[]
=
'CHECK ('
.
$def
.
')'
;
$constraints
[]
=
'CHECK ('
.
$def
.
')'
;
...
@@ -2398,7 +2398,7 @@ abstract class AbstractPlatform
...
@@ -2398,7 +2398,7 @@ abstract class AbstractPlatform
*/
*/
public
function
getIndexFieldDeclarationListSQL
(
array
$fields
)
public
function
getIndexFieldDeclarationListSQL
(
array
$fields
)
{
{
$ret
=
array
()
;
$ret
=
[]
;
foreach
(
$fields
as
$field
=>
$definition
)
{
foreach
(
$fields
as
$field
=>
$definition
)
{
if
(
is_array
(
$definition
))
{
if
(
is_array
(
$definition
))
{
...
...
lib/Doctrine/DBAL/Platforms/DB2Platform.php
View file @
80f42dc7
...
@@ -59,7 +59,7 @@ class DB2Platform extends AbstractPlatform
...
@@ -59,7 +59,7 @@ class DB2Platform extends AbstractPlatform
*/
*/
public
function
initializeDoctrineTypeMappings
()
public
function
initializeDoctrineTypeMappings
()
{
{
$this
->
doctrineTypeMapping
=
array
(
$this
->
doctrineTypeMapping
=
[
'smallint'
=>
'smallint'
,
'smallint'
=>
'smallint'
,
'bigint'
=>
'bigint'
,
'bigint'
=>
'bigint'
,
'integer'
=>
'integer'
,
'integer'
=>
'integer'
,
...
@@ -75,7 +75,7 @@ class DB2Platform extends AbstractPlatform
...
@@ -75,7 +75,7 @@ class DB2Platform extends AbstractPlatform
'double'
=>
'float'
,
'double'
=>
'float'
,
'real'
=>
'float'
,
'real'
=>
'float'
,
'timestamp'
=>
'datetime'
,
'timestamp'
=>
'datetime'
,
)
;
]
;
}
}
/**
/**
...
@@ -477,13 +477,13 @@ class DB2Platform extends AbstractPlatform
...
@@ -477,13 +477,13 @@ class DB2Platform extends AbstractPlatform
/**
/**
* {@inheritDoc}
* {@inheritDoc}
*/
*/
protected
function
_getCreateTableSQL
(
$tableName
,
array
$columns
,
array
$options
=
array
()
)
protected
function
_getCreateTableSQL
(
$tableName
,
array
$columns
,
array
$options
=
[]
)
{
{
$indexes
=
array
()
;
$indexes
=
[]
;
if
(
isset
(
$options
[
'indexes'
]))
{
if
(
isset
(
$options
[
'indexes'
]))
{
$indexes
=
$options
[
'indexes'
];
$indexes
=
$options
[
'indexes'
];
}
}
$options
[
'indexes'
]
=
array
()
;
$options
[
'indexes'
]
=
[]
;
$sqls
=
parent
::
_getCreateTableSQL
(
$tableName
,
$columns
,
$options
);
$sqls
=
parent
::
_getCreateTableSQL
(
$tableName
,
$columns
,
$options
);
...
@@ -498,11 +498,11 @@ class DB2Platform extends AbstractPlatform
...
@@ -498,11 +498,11 @@ class DB2Platform extends AbstractPlatform
*/
*/
public
function
getAlterTableSQL
(
TableDiff
$diff
)
public
function
getAlterTableSQL
(
TableDiff
$diff
)
{
{
$sql
=
array
()
;
$sql
=
[]
;
$columnSql
=
array
()
;
$columnSql
=
[]
;
$commentsSQL
=
array
()
;
$commentsSQL
=
[]
;
$queryParts
=
array
()
;
$queryParts
=
[]
;
foreach
(
$diff
->
addedColumns
as
$column
)
{
foreach
(
$diff
->
addedColumns
as
$column
)
{
if
(
$this
->
onSchemaAlterTableAddColumn
(
$column
,
$diff
,
$columnSql
))
{
if
(
$this
->
onSchemaAlterTableAddColumn
(
$column
,
$diff
,
$columnSql
))
{
continue
;
continue
;
...
@@ -571,7 +571,7 @@ class DB2Platform extends AbstractPlatform
...
@@ -571,7 +571,7 @@ class DB2Platform extends AbstractPlatform
' TO '
.
$column
->
getQuotedName
(
$this
);
' TO '
.
$column
->
getQuotedName
(
$this
);
}
}
$tableSql
=
array
()
;
$tableSql
=
[]
;
if
(
!
$this
->
onSchemaAlterTable
(
$diff
,
$tableSql
))
{
if
(
!
$this
->
onSchemaAlterTable
(
$diff
,
$tableSql
))
{
if
(
count
(
$queryParts
)
>
0
)
{
if
(
count
(
$queryParts
)
>
0
)
{
...
@@ -644,10 +644,10 @@ class DB2Platform extends AbstractPlatform
...
@@ -644,10 +644,10 @@ class DB2Platform extends AbstractPlatform
$alterClause
=
'ALTER COLUMN '
.
$columnDiff
->
column
->
getQuotedName
(
$this
);
$alterClause
=
'ALTER COLUMN '
.
$columnDiff
->
column
->
getQuotedName
(
$this
);
if
(
$column
[
'columnDefinition'
])
{
if
(
$column
[
'columnDefinition'
])
{
return
array
(
$alterClause
.
' '
.
$column
[
'columnDefinition'
])
;
return
[
$alterClause
.
' '
.
$column
[
'columnDefinition'
]]
;
}
}
$clauses
=
array
()
;
$clauses
=
[]
;
if
(
$columnDiff
->
hasChanged
(
'type'
)
||
if
(
$columnDiff
->
hasChanged
(
'type'
)
||
$columnDiff
->
hasChanged
(
'length'
)
||
$columnDiff
->
hasChanged
(
'length'
)
||
...
@@ -682,7 +682,7 @@ class DB2Platform extends AbstractPlatform
...
@@ -682,7 +682,7 @@ class DB2Platform extends AbstractPlatform
*/
*/
protected
function
getPreAlterTableIndexForeignKeySQL
(
TableDiff
$diff
)
protected
function
getPreAlterTableIndexForeignKeySQL
(
TableDiff
$diff
)
{
{
$sql
=
array
()
;
$sql
=
[]
;
$table
=
$diff
->
getName
(
$this
)
->
getQuotedName
(
$this
);
$table
=
$diff
->
getName
(
$this
)
->
getQuotedName
(
$this
);
foreach
(
$diff
->
removedIndexes
as
$remKey
=>
$remIndex
)
{
foreach
(
$diff
->
removedIndexes
as
$remKey
=>
$remIndex
)
{
...
@@ -721,7 +721,7 @@ class DB2Platform extends AbstractPlatform
...
@@ -721,7 +721,7 @@ class DB2Platform extends AbstractPlatform
$oldIndexName
=
$schema
.
'.'
.
$oldIndexName
;
$oldIndexName
=
$schema
.
'.'
.
$oldIndexName
;
}
}
return
array
(
'RENAME INDEX '
.
$oldIndexName
.
' TO '
.
$index
->
getQuotedName
(
$this
))
;
return
[
'RENAME INDEX '
.
$oldIndexName
.
' TO '
.
$index
->
getQuotedName
(
$this
)]
;
}
}
/**
/**
...
@@ -771,7 +771,7 @@ class DB2Platform extends AbstractPlatform
...
@@ -771,7 +771,7 @@ class DB2Platform extends AbstractPlatform
*/
*/
protected
function
doModifyLimitQuery
(
$query
,
$limit
,
$offset
=
null
)
protected
function
doModifyLimitQuery
(
$query
,
$limit
,
$offset
=
null
)
{
{
$where
=
array
()
;
$where
=
[]
;
if
(
$offset
>
0
)
{
if
(
$offset
>
0
)
{
$where
[]
=
sprintf
(
'db22.DC_ROWNUM >= %d'
,
$offset
+
1
);
$where
[]
=
sprintf
(
'db22.DC_ROWNUM >= %d'
,
$offset
+
1
);
...
...
lib/Doctrine/DBAL/Platforms/DrizzlePlatform.php
View file @
80f42dc7
...
@@ -142,7 +142,7 @@ class DrizzlePlatform extends AbstractPlatform
...
@@ -142,7 +142,7 @@ class DrizzlePlatform extends AbstractPlatform
*/
*/
protected
function
initializeDoctrineTypeMappings
()
protected
function
initializeDoctrineTypeMappings
()
{
{
$this
->
doctrineTypeMapping
=
array
(
$this
->
doctrineTypeMapping
=
[
'boolean'
=>
'boolean'
,
'boolean'
=>
'boolean'
,
'varchar'
=>
'string'
,
'varchar'
=>
'string'
,
'varbinary'
=>
'binary'
,
'varbinary'
=>
'binary'
,
...
@@ -156,7 +156,7 @@ class DrizzlePlatform extends AbstractPlatform
...
@@ -156,7 +156,7 @@ class DrizzlePlatform extends AbstractPlatform
'timestamp'
=>
'datetime'
,
'timestamp'
=>
'datetime'
,
'double'
=>
'float'
,
'double'
=>
'float'
,
'bigint'
=>
'bigint'
,
'bigint'
=>
'bigint'
,
)
;
]
;
}
}
/**
/**
...
@@ -194,7 +194,7 @@ class DrizzlePlatform extends AbstractPlatform
...
@@ -194,7 +194,7 @@ class DrizzlePlatform extends AbstractPlatform
/**
/**
* {@inheritDoc}
* {@inheritDoc}
*/
*/
protected
function
_getCreateTableSQL
(
$tableName
,
array
$columns
,
array
$options
=
array
()
)
protected
function
_getCreateTableSQL
(
$tableName
,
array
$columns
,
array
$options
=
[]
)
{
{
$queryFields
=
$this
->
getColumnDeclarationListSQL
(
$columns
);
$queryFields
=
$this
->
getColumnDeclarationListSQL
(
$columns
);
...
@@ -251,7 +251,7 @@ class DrizzlePlatform extends AbstractPlatform
...
@@ -251,7 +251,7 @@ class DrizzlePlatform extends AbstractPlatform
return
$options
[
'table_options'
];
return
$options
[
'table_options'
];
}
}
$tableOptions
=
array
()
;
$tableOptions
=
[]
;
// Collate
// Collate
if
(
!
isset
(
$options
[
'collate'
]))
{
if
(
!
isset
(
$options
[
'collate'
]))
{
...
@@ -483,8 +483,8 @@ class DrizzlePlatform extends AbstractPlatform
...
@@ -483,8 +483,8 @@ class DrizzlePlatform extends AbstractPlatform
*/
*/
public
function
getAlterTableSQL
(
TableDiff
$diff
)
public
function
getAlterTableSQL
(
TableDiff
$diff
)
{
{
$columnSql
=
array
()
;
$columnSql
=
[]
;
$queryParts
=
array
()
;
$queryParts
=
[]
;
if
(
$diff
->
newName
!==
false
)
{
if
(
$diff
->
newName
!==
false
)
{
$queryParts
[]
=
'RENAME TO '
.
$diff
->
getNewName
()
->
getQuotedName
(
$this
);
$queryParts
[]
=
'RENAME TO '
.
$diff
->
getNewName
()
->
getQuotedName
(
$this
);
...
@@ -545,8 +545,8 @@ class DrizzlePlatform extends AbstractPlatform
...
@@ -545,8 +545,8 @@ class DrizzlePlatform extends AbstractPlatform
.
$this
->
getColumnDeclarationSQL
(
$column
->
getQuotedName
(
$this
),
$columnArray
);
.
$this
->
getColumnDeclarationSQL
(
$column
->
getQuotedName
(
$this
),
$columnArray
);
}
}
$sql
=
array
()
;
$sql
=
[]
;
$tableSql
=
array
()
;
$tableSql
=
[]
;
if
(
!
$this
->
onSchemaAlterTable
(
$diff
,
$tableSql
))
{
if
(
!
$this
->
onSchemaAlterTable
(
$diff
,
$tableSql
))
{
if
(
count
(
$queryParts
)
>
0
)
{
if
(
count
(
$queryParts
)
>
0
)
{
...
...
lib/Doctrine/DBAL/Platforms/Keywords/DB2Keywords.php
View file @
80f42dc7
...
@@ -41,7 +41,7 @@ class DB2Keywords extends KeywordList
...
@@ -41,7 +41,7 @@ class DB2Keywords extends KeywordList
*/
*/
protected
function
getKeywords
()
protected
function
getKeywords
()
{
{
return
array
(
return
[
'ACTIVATE'
,
'ACTIVATE'
,
'ADD'
,
'ADD'
,
'AFTER'
,
'AFTER'
,
...
@@ -436,6 +436,6 @@ class DB2Keywords extends KeywordList
...
@@ -436,6 +436,6 @@ class DB2Keywords extends KeywordList
'LOCATORS'
,
'LOCATORS'
,
'ROLLBACK'
,
'ROLLBACK'
,
'YEARS'
,
'YEARS'
,
)
;
]
;
}
}
}
}
lib/Doctrine/DBAL/Platforms/Keywords/DrizzleKeywords.php
View file @
80f42dc7
...
@@ -39,7 +39,7 @@ class DrizzleKeywords extends KeywordList
...
@@ -39,7 +39,7 @@ class DrizzleKeywords extends KeywordList
*/
*/
protected
function
getKeywords
()
protected
function
getKeywords
()
{
{
return
array
(
return
[
'ABS'
,
'ABS'
,
'ALL'
,
'ALL'
,
'ALLOCATE'
,
'ALLOCATE'
,
...
@@ -340,6 +340,6 @@ class DrizzleKeywords extends KeywordList
...
@@ -340,6 +340,6 @@ class DrizzleKeywords extends KeywordList
'XMLROOT'
,
'XMLROOT'
,
'XMLSERIALIZE'
,
'XMLSERIALIZE'
,
'YEAR'
,
'YEAR'
,
)
;
]
;
}
}
}
}
lib/Doctrine/DBAL/Platforms/Keywords/MySQL57Keywords.php
View file @
80f42dc7
...
@@ -43,7 +43,7 @@ class MySQL57Keywords extends MySQLKeywords
...
@@ -43,7 +43,7 @@ class MySQL57Keywords extends MySQLKeywords
*/
*/
protected
function
getKeywords
()
protected
function
getKeywords
()
{
{
return
array
(
return
[
'ACCESSIBLE'
,
'ACCESSIBLE'
,
'ADD'
,
'ADD'
,
'ALL'
,
'ALL'
,
...
@@ -279,6 +279,6 @@ class MySQL57Keywords extends MySQLKeywords
...
@@ -279,6 +279,6 @@ class MySQL57Keywords extends MySQLKeywords
'XOR'
,
'XOR'
,
'YEAR_MONTH'
,
'YEAR_MONTH'
,
'ZEROFILL'
,
'ZEROFILL'
,
)
;
]
;
}
}
}
}
lib/Doctrine/DBAL/Platforms/Keywords/MySQLKeywords.php
View file @
80f42dc7
...
@@ -42,7 +42,7 @@ class MySQLKeywords extends KeywordList
...
@@ -42,7 +42,7 @@ class MySQLKeywords extends KeywordList
*/
*/
protected
function
getKeywords
()
protected
function
getKeywords
()
{
{
return
array
(
return
[
'ACCESSIBLE'
,
'ACCESSIBLE'
,
'ADD'
,
'ADD'
,
'ALL'
,
'ALL'
,
...
@@ -282,6 +282,6 @@ class MySQLKeywords extends KeywordList
...
@@ -282,6 +282,6 @@ class MySQLKeywords extends KeywordList
'XOR'
,
'XOR'
,
'YEAR_MONTH'
,
'YEAR_MONTH'
,
'ZEROFILL'
,
'ZEROFILL'
,
)
;
]
;
}
}
}
}
lib/Doctrine/DBAL/Platforms/Keywords/OracleKeywords.php
View file @
80f42dc7
...
@@ -42,7 +42,7 @@ class OracleKeywords extends KeywordList
...
@@ -42,7 +42,7 @@ class OracleKeywords extends KeywordList
*/
*/
protected
function
getKeywords
()
protected
function
getKeywords
()
{
{
return
array
(
return
[
'ACCESS'
,
'ACCESS'
,
'ELSE'
,
'ELSE'
,
'MODIFY'
,
'MODIFY'
,
...
@@ -156,6 +156,6 @@ class OracleKeywords extends KeywordList
...
@@ -156,6 +156,6 @@ class OracleKeywords extends KeywordList
'ROWS'
,
'ROWS'
,
'WITH'
,
'WITH'
,
'RANGE'
,
'RANGE'
,
)
;
]
;
}
}
}
}
lib/Doctrine/DBAL/Platforms/Keywords/PostgreSQL91Keywords.php
View file @
80f42dc7
...
@@ -44,7 +44,7 @@ class PostgreSQL91Keywords extends PostgreSQLKeywords
...
@@ -44,7 +44,7 @@ class PostgreSQL91Keywords extends PostgreSQLKeywords
*/
*/
protected
function
getKeywords
()
protected
function
getKeywords
()
{
{
return
array
(
return
[
'ALL'
,
'ALL'
,
'ANALYSE'
,
'ANALYSE'
,
'ANALYZE'
,
'ANALYZE'
,
...
@@ -143,6 +143,6 @@ class PostgreSQL91Keywords extends PostgreSQLKeywords
...
@@ -143,6 +143,6 @@ class PostgreSQL91Keywords extends PostgreSQLKeywords
'WHERE'
,
'WHERE'
,
'WINDOW'
,
'WINDOW'
,
'WITH'
,
'WITH'
,
)
;
]
;
}
}
}
}
lib/Doctrine/DBAL/Platforms/Keywords/PostgreSQL92Keywords.php
View file @
80f42dc7
...
@@ -43,8 +43,8 @@ class PostgreSQL92Keywords extends PostgreSQL91Keywords
...
@@ -43,8 +43,8 @@ class PostgreSQL92Keywords extends PostgreSQL91Keywords
*/
*/
protected
function
getKeywords
()
protected
function
getKeywords
()
{
{
return
array_merge
(
parent
::
getKeywords
(),
array
(
return
array_merge
(
parent
::
getKeywords
(),
[
'COLLATION'
,
'COLLATION'
,
)
);
]
);
}
}
}
}
lib/Doctrine/DBAL/Platforms/Keywords/PostgreSQL94Keywords.php
View file @
80f42dc7
...
@@ -43,12 +43,12 @@ class PostgreSQL94Keywords extends PostgreSQL92Keywords
...
@@ -43,12 +43,12 @@ class PostgreSQL94Keywords extends PostgreSQL92Keywords
*/
*/
protected
function
getKeywords
()
protected
function
getKeywords
()
{
{
$parentKeywords
=
array_diff
(
parent
::
getKeywords
(),
array
(
$parentKeywords
=
array_diff
(
parent
::
getKeywords
(),
[
'OVER'
,
'OVER'
,
)
);
]
);
return
array_merge
(
$parentKeywords
,
array
(
return
array_merge
(
$parentKeywords
,
[
'LATERAL'
,
'LATERAL'
,
)
);
]
);
}
}
}
}
lib/Doctrine/DBAL/Platforms/Keywords/PostgreSQLKeywords.php
View file @
80f42dc7
...
@@ -42,7 +42,7 @@ class PostgreSQLKeywords extends KeywordList
...
@@ -42,7 +42,7 @@ class PostgreSQLKeywords extends KeywordList
*/
*/
protected
function
getKeywords
()
protected
function
getKeywords
()
{
{
return
array
(
return
[
'ALL'
,
'ALL'
,
'ANALYSE'
,
'ANALYSE'
,
'ANALYZE'
,
'ANALYZE'
,
...
@@ -130,6 +130,6 @@ class PostgreSQLKeywords extends KeywordList
...
@@ -130,6 +130,6 @@ class PostgreSQLKeywords extends KeywordList
'VERBOSE'
,
'VERBOSE'
,
'WHEN'
,
'WHEN'
,
'WHERE'
'WHERE'
)
;
]
;
}
}
}
}
lib/Doctrine/DBAL/Platforms/Keywords/ReservedKeywordsValidator.php
View file @
80f42dc7
...
@@ -32,12 +32,12 @@ class ReservedKeywordsValidator implements Visitor
...
@@ -32,12 +32,12 @@ class ReservedKeywordsValidator implements Visitor
/**
/**
* @var KeywordList[]
* @var KeywordList[]
*/
*/
private
$keywordLists
=
array
()
;
private
$keywordLists
=
[]
;
/**
/**
* @var array
* @var array
*/
*/
private
$violations
=
array
()
;
private
$violations
=
[]
;
/**
/**
* @param \Doctrine\DBAL\Platforms\Keywords\KeywordList[] $keywordLists
* @param \Doctrine\DBAL\Platforms\Keywords\KeywordList[] $keywordLists
...
@@ -66,7 +66,7 @@ class ReservedKeywordsValidator implements Visitor
...
@@ -66,7 +66,7 @@ class ReservedKeywordsValidator implements Visitor
$word
=
str_replace
(
'`'
,
''
,
$word
);
$word
=
str_replace
(
'`'
,
''
,
$word
);
}
}
$keywordLists
=
array
()
;
$keywordLists
=
[]
;
foreach
(
$this
->
keywordLists
as
$keywordList
)
{
foreach
(
$this
->
keywordLists
as
$keywordList
)
{
if
(
$keywordList
->
isKeyword
(
$word
))
{
if
(
$keywordList
->
isKeyword
(
$word
))
{
$keywordLists
[]
=
$keywordList
->
getName
();
$keywordLists
[]
=
$keywordList
->
getName
();
...
...
lib/Doctrine/DBAL/Platforms/Keywords/SQLAnywhere11Keywords.php
View file @
80f42dc7
...
@@ -44,12 +44,12 @@ class SQLAnywhere11Keywords extends SQLAnywhereKeywords
...
@@ -44,12 +44,12 @@ class SQLAnywhere11Keywords extends SQLAnywhereKeywords
return
array_merge
(
return
array_merge
(
array_diff
(
array_diff
(
parent
::
getKeywords
(),
parent
::
getKeywords
(),
array
(
'IQ'
)
[
'IQ'
]
),
),
array
(
[
'MERGE'
,
'MERGE'
,
'OPENSTRING'
'OPENSTRING'
)
]
);
);
}
}
}
}
lib/Doctrine/DBAL/Platforms/Keywords/SQLAnywhere12Keywords.php
View file @
80f42dc7
...
@@ -44,21 +44,21 @@ class SQLAnywhere12Keywords extends SQLAnywhere11Keywords
...
@@ -44,21 +44,21 @@ class SQLAnywhere12Keywords extends SQLAnywhere11Keywords
return
array_merge
(
return
array_merge
(
array_diff
(
array_diff
(
parent
::
getKeywords
(),
parent
::
getKeywords
(),
array
(
[
'INDEX_LPAREN'
,
'INDEX_LPAREN'
,
'SYNTAX_ERROR'
,
'SYNTAX_ERROR'
,
'WITH_CUBE'
,
'WITH_CUBE'
,
'WITH_LPAREN'
,
'WITH_LPAREN'
,
'WITH_ROLLUP'
'WITH_ROLLUP'
)
]
),
),
array
(
[
'DATETIMEOFFSET'
,
'DATETIMEOFFSET'
,
'LIMIT'
,
'LIMIT'
,
'OPENXML'
,
'OPENXML'
,
'SPATIAL'
,
'SPATIAL'
,
'TREAT'
'TREAT'
)
]
);
);
}
}
}
}
lib/Doctrine/DBAL/Platforms/Keywords/SQLAnywhere16Keywords.php
View file @
80f42dc7
...
@@ -43,14 +43,14 @@ class SQLAnywhere16Keywords extends SQLAnywhere12Keywords
...
@@ -43,14 +43,14 @@ class SQLAnywhere16Keywords extends SQLAnywhere12Keywords
{
{
return
array_merge
(
return
array_merge
(
parent
::
getKeywords
(),
parent
::
getKeywords
(),
array
(
[
'ARRAY'
,
'ARRAY'
,
'JSON'
,
'JSON'
,
'ROW'
,
'ROW'
,
'ROWTYPE'
,
'ROWTYPE'
,
'UNNEST'
,
'UNNEST'
,
'VARRAY'
'VARRAY'
)
]
);
);
}
}
}
}
lib/Doctrine/DBAL/Platforms/Keywords/SQLAnywhereKeywords.php
View file @
80f42dc7
...
@@ -41,7 +41,7 @@ class SQLAnywhereKeywords extends KeywordList
...
@@ -41,7 +41,7 @@ class SQLAnywhereKeywords extends KeywordList
*/
*/
protected
function
getKeywords
()
protected
function
getKeywords
()
{
{
return
array
(
return
[
'ADD'
,
'ADD'
,
'ALL'
,
'ALL'
,
'ALTER'
,
'ALTER'
,
...
@@ -276,6 +276,6 @@ class SQLAnywhereKeywords extends KeywordList
...
@@ -276,6 +276,6 @@ class SQLAnywhereKeywords extends KeywordList
'WORK'
,
'WORK'
,
'WRITETEXT'
,
'WRITETEXT'
,
'XML'
'XML'
)
;
]
;
}
}
}
}
lib/Doctrine/DBAL/Platforms/Keywords/SQLServer2005Keywords.php
View file @
80f42dc7
...
@@ -44,13 +44,13 @@ class SQLServer2005Keywords extends SQLServerKeywords
...
@@ -44,13 +44,13 @@ class SQLServer2005Keywords extends SQLServerKeywords
*/
*/
protected
function
getKeywords
()
protected
function
getKeywords
()
{
{
return
array_merge
(
array_diff
(
parent
::
getKeywords
(),
array
(
'DUMMY'
)),
array
(
return
array_merge
(
array_diff
(
parent
::
getKeywords
(),
[
'DUMMY'
]),
[
'EXTERNAL'
,
'EXTERNAL'
,
'PIVOT'
,
'PIVOT'
,
'REVERT'
,
'REVERT'
,
'SECURITYAUDIT'
,
'SECURITYAUDIT'
,
'TABLESAMPLE'
,
'TABLESAMPLE'
,
'UNPIVOT'
'UNPIVOT'
)
);
]
);
}
}
}
}
lib/Doctrine/DBAL/Platforms/Keywords/SQLServer2008Keywords.php
View file @
80f42dc7
...
@@ -44,8 +44,8 @@ class SQLServer2008Keywords extends SQLServer2005Keywords
...
@@ -44,8 +44,8 @@ class SQLServer2008Keywords extends SQLServer2005Keywords
*/
*/
protected
function
getKeywords
()
protected
function
getKeywords
()
{
{
return
array_merge
(
parent
::
getKeywords
(),
array
(
return
array_merge
(
parent
::
getKeywords
(),
[
'MERGE'
'MERGE'
)
);
]
);
}
}
}
}
lib/Doctrine/DBAL/Platforms/Keywords/SQLServer2012Keywords.php
View file @
80f42dc7
...
@@ -44,12 +44,12 @@ class SQLServer2012Keywords extends SQLServer2008Keywords
...
@@ -44,12 +44,12 @@ class SQLServer2012Keywords extends SQLServer2008Keywords
*/
*/
protected
function
getKeywords
()
protected
function
getKeywords
()
{
{
return
array_merge
(
parent
::
getKeywords
(),
array
(
return
array_merge
(
parent
::
getKeywords
(),
[
'SEMANTICKEYPHRASETABLE'
,
'SEMANTICKEYPHRASETABLE'
,
'SEMANTICSIMILARITYDETAILSTABLE'
,
'SEMANTICSIMILARITYDETAILSTABLE'
,
'SEMANTICSIMILARITYTABLE'
,
'SEMANTICSIMILARITYTABLE'
,
'TRY_CONVERT'
,
'TRY_CONVERT'
,
'WITHIN GROUP'
'WITHIN GROUP'
)
);
]
);
}
}
}
}
lib/Doctrine/DBAL/Platforms/Keywords/SQLServerKeywords.php
View file @
80f42dc7
...
@@ -46,7 +46,7 @@ class SQLServerKeywords extends KeywordList
...
@@ -46,7 +46,7 @@ class SQLServerKeywords extends KeywordList
*/
*/
protected
function
getKeywords
()
protected
function
getKeywords
()
{
{
return
array
(
return
[
'ADD'
,
'ADD'
,
'ALL'
,
'ALL'
,
'ALTER'
,
'ALTER'
,
...
@@ -226,6 +226,6 @@ class SQLServerKeywords extends KeywordList
...
@@ -226,6 +226,6 @@ class SQLServerKeywords extends KeywordList
'WHILE'
,
'WHILE'
,
'WITH'
,
'WITH'
,
'WRITETEXT'
'WRITETEXT'
)
;
]
;
}
}
}
}
lib/Doctrine/DBAL/Platforms/Keywords/SQLiteKeywords.php
View file @
80f42dc7
...
@@ -41,7 +41,7 @@ class SQLiteKeywords extends KeywordList
...
@@ -41,7 +41,7 @@ class SQLiteKeywords extends KeywordList
*/
*/
protected
function
getKeywords
()
protected
function
getKeywords
()
{
{
return
array
(
return
[
'ABORT'
,
'ABORT'
,
'ACTION'
,
'ACTION'
,
'ADD'
,
'ADD'
,
...
@@ -163,6 +163,6 @@ class SQLiteKeywords extends KeywordList
...
@@ -163,6 +163,6 @@ class SQLiteKeywords extends KeywordList
'VIRTUAL'
,
'VIRTUAL'
,
'WHEN'
,
'WHEN'
,
'WHERE'
'WHERE'
)
;
]
;
}
}
}
}
lib/Doctrine/DBAL/Platforms/MySQL57Platform.php
View file @
80f42dc7
...
@@ -54,7 +54,7 @@ class MySQL57Platform extends MySqlPlatform
...
@@ -54,7 +54,7 @@ class MySQL57Platform extends MySqlPlatform
*/
*/
protected
function
getPreAlterTableRenameIndexForeignKeySQL
(
TableDiff
$diff
)
protected
function
getPreAlterTableRenameIndexForeignKeySQL
(
TableDiff
$diff
)
{
{
return
array
()
;
return
[]
;
}
}
/**
/**
...
@@ -62,7 +62,7 @@ class MySQL57Platform extends MySqlPlatform
...
@@ -62,7 +62,7 @@ class MySQL57Platform extends MySqlPlatform
*/
*/
protected
function
getPostAlterTableRenameIndexForeignKeySQL
(
TableDiff
$diff
)
protected
function
getPostAlterTableRenameIndexForeignKeySQL
(
TableDiff
$diff
)
{
{
return
array
()
;
return
[]
;
}
}
/**
/**
...
@@ -70,9 +70,9 @@ class MySQL57Platform extends MySqlPlatform
...
@@ -70,9 +70,9 @@ class MySQL57Platform extends MySqlPlatform
*/
*/
protected
function
getRenameIndexSQL
(
$oldIndexName
,
Index
$index
,
$tableName
)
protected
function
getRenameIndexSQL
(
$oldIndexName
,
Index
$index
,
$tableName
)
{
{
return
array
(
return
[
'ALTER TABLE '
.
$tableName
.
' RENAME INDEX '
.
$oldIndexName
.
' TO '
.
$index
->
getQuotedName
(
$this
)
'ALTER TABLE '
.
$tableName
.
' RENAME INDEX '
.
$oldIndexName
.
' TO '
.
$index
->
getQuotedName
(
$this
)
)
;
]
;
}
}
/**
/**
...
...
lib/Doctrine/DBAL/Platforms/MySqlPlatform.php
View file @
80f42dc7
...
@@ -409,7 +409,7 @@ class MySqlPlatform extends AbstractPlatform
...
@@ -409,7 +409,7 @@ class MySqlPlatform extends AbstractPlatform
/**
/**
* {@inheritDoc}
* {@inheritDoc}
*/
*/
protected
function
_getCreateTableSQL
(
$tableName
,
array
$columns
,
array
$options
=
array
()
)
protected
function
_getCreateTableSQL
(
$tableName
,
array
$columns
,
array
$options
=
[]
)
{
{
$queryFields
=
$this
->
getColumnDeclarationListSQL
(
$columns
);
$queryFields
=
$this
->
getColumnDeclarationListSQL
(
$columns
);
...
@@ -485,7 +485,7 @@ class MySqlPlatform extends AbstractPlatform
...
@@ -485,7 +485,7 @@ class MySqlPlatform extends AbstractPlatform
return
$options
[
'table_options'
];
return
$options
[
'table_options'
];
}
}
$tableOptions
=
array
()
;
$tableOptions
=
[]
;
// Charset
// Charset
if
(
!
isset
(
$options
[
'charset'
]))
{
if
(
!
isset
(
$options
[
'charset'
]))
{
...
@@ -547,8 +547,8 @@ class MySqlPlatform extends AbstractPlatform
...
@@ -547,8 +547,8 @@ class MySqlPlatform extends AbstractPlatform
*/
*/
public
function
getAlterTableSQL
(
TableDiff
$diff
)
public
function
getAlterTableSQL
(
TableDiff
$diff
)
{
{
$columnSql
=
array
()
;
$columnSql
=
[]
;
$queryParts
=
array
()
;
$queryParts
=
[]
;
if
(
$diff
->
newName
!==
false
)
{
if
(
$diff
->
newName
!==
false
)
{
$queryParts
[]
=
'RENAME TO '
.
$diff
->
getNewName
()
->
getQuotedName
(
$this
);
$queryParts
[]
=
'RENAME TO '
.
$diff
->
getNewName
()
->
getQuotedName
(
$this
);
}
}
...
@@ -611,8 +611,8 @@ class MySqlPlatform extends AbstractPlatform
...
@@ -611,8 +611,8 @@ class MySqlPlatform extends AbstractPlatform
unset
(
$diff
->
addedIndexes
[
'primary'
]);
unset
(
$diff
->
addedIndexes
[
'primary'
]);
}
}
$sql
=
array
()
;
$sql
=
[]
;
$tableSql
=
array
()
;
$tableSql
=
[]
;
if
(
!
$this
->
onSchemaAlterTable
(
$diff
,
$tableSql
))
{
if
(
!
$this
->
onSchemaAlterTable
(
$diff
,
$tableSql
))
{
if
(
count
(
$queryParts
)
>
0
)
{
if
(
count
(
$queryParts
)
>
0
)
{
...
@@ -633,7 +633,7 @@ class MySqlPlatform extends AbstractPlatform
...
@@ -633,7 +633,7 @@ class MySqlPlatform extends AbstractPlatform
*/
*/
protected
function
getPreAlterTableIndexForeignKeySQL
(
TableDiff
$diff
)
protected
function
getPreAlterTableIndexForeignKeySQL
(
TableDiff
$diff
)
{
{
$sql
=
array
()
;
$sql
=
[]
;
$table
=
$diff
->
getName
(
$this
)
->
getQuotedName
(
$this
);
$table
=
$diff
->
getName
(
$this
)
->
getQuotedName
(
$this
);
foreach
(
$diff
->
changedIndexes
as
$changedIndex
)
{
foreach
(
$diff
->
changedIndexes
as
$changedIndex
)
{
...
@@ -676,9 +676,9 @@ class MySqlPlatform extends AbstractPlatform
...
@@ -676,9 +676,9 @@ class MySqlPlatform extends AbstractPlatform
// Suppress foreign key constraint propagation on non-supporting engines.
// Suppress foreign key constraint propagation on non-supporting engines.
if
(
'INNODB'
!==
$engine
)
{
if
(
'INNODB'
!==
$engine
)
{
$diff
->
addedForeignKeys
=
array
()
;
$diff
->
addedForeignKeys
=
[]
;
$diff
->
changedForeignKeys
=
array
()
;
$diff
->
changedForeignKeys
=
[]
;
$diff
->
removedForeignKeys
=
array
()
;
$diff
->
removedForeignKeys
=
[]
;
}
}
$sql
=
array_merge
(
$sql
=
array_merge
(
...
@@ -699,7 +699,7 @@ class MySqlPlatform extends AbstractPlatform
...
@@ -699,7 +699,7 @@ class MySqlPlatform extends AbstractPlatform
*/
*/
private
function
getPreAlterTableAlterPrimaryKeySQL
(
TableDiff
$diff
,
Index
$index
)
private
function
getPreAlterTableAlterPrimaryKeySQL
(
TableDiff
$diff
,
Index
$index
)
{
{
$sql
=
array
()
;
$sql
=
[]
;
if
(
!
$index
->
isPrimary
()
||
!
$diff
->
fromTable
instanceof
Table
)
{
if
(
!
$index
->
isPrimary
()
||
!
$diff
->
fromTable
instanceof
Table
)
{
return
$sql
;
return
$sql
;
...
@@ -736,7 +736,7 @@ class MySqlPlatform extends AbstractPlatform
...
@@ -736,7 +736,7 @@ class MySqlPlatform extends AbstractPlatform
*/
*/
private
function
getPreAlterTableAlterIndexForeignKeySQL
(
TableDiff
$diff
)
private
function
getPreAlterTableAlterIndexForeignKeySQL
(
TableDiff
$diff
)
{
{
$sql
=
array
()
;
$sql
=
[]
;
$table
=
$diff
->
getName
(
$this
)
->
getQuotedName
(
$this
);
$table
=
$diff
->
getName
(
$this
)
->
getQuotedName
(
$this
);
foreach
(
$diff
->
changedIndexes
as
$changedIndex
)
{
foreach
(
$diff
->
changedIndexes
as
$changedIndex
)
{
...
@@ -772,7 +772,7 @@ class MySqlPlatform extends AbstractPlatform
...
@@ -772,7 +772,7 @@ class MySqlPlatform extends AbstractPlatform
*/
*/
protected
function
getPreAlterTableRenameIndexForeignKeySQL
(
TableDiff
$diff
)
protected
function
getPreAlterTableRenameIndexForeignKeySQL
(
TableDiff
$diff
)
{
{
$sql
=
array
()
;
$sql
=
[]
;
$tableName
=
$diff
->
getName
(
$this
)
->
getQuotedName
(
$this
);
$tableName
=
$diff
->
getName
(
$this
)
->
getQuotedName
(
$this
);
foreach
(
$this
->
getRemainingForeignKeyConstraintsRequiringRenamedIndexes
(
$diff
)
as
$foreignKey
)
{
foreach
(
$this
->
getRemainingForeignKeyConstraintsRequiringRenamedIndexes
(
$diff
)
as
$foreignKey
)
{
...
@@ -797,10 +797,10 @@ class MySqlPlatform extends AbstractPlatform
...
@@ -797,10 +797,10 @@ class MySqlPlatform extends AbstractPlatform
private
function
getRemainingForeignKeyConstraintsRequiringRenamedIndexes
(
TableDiff
$diff
)
private
function
getRemainingForeignKeyConstraintsRequiringRenamedIndexes
(
TableDiff
$diff
)
{
{
if
(
empty
(
$diff
->
renamedIndexes
)
||
!
$diff
->
fromTable
instanceof
Table
)
{
if
(
empty
(
$diff
->
renamedIndexes
)
||
!
$diff
->
fromTable
instanceof
Table
)
{
return
array
()
;
return
[]
;
}
}
$foreignKeys
=
array
()
;
$foreignKeys
=
[]
;
/** @var \Doctrine\DBAL\Schema\ForeignKeyConstraint[] $remainingForeignKeys */
/** @var \Doctrine\DBAL\Schema\ForeignKeyConstraint[] $remainingForeignKeys */
$remainingForeignKeys
=
array_diff_key
(
$remainingForeignKeys
=
array_diff_key
(
$diff
->
fromTable
->
getForeignKeys
(),
$diff
->
fromTable
->
getForeignKeys
(),
...
@@ -838,7 +838,7 @@ class MySqlPlatform extends AbstractPlatform
...
@@ -838,7 +838,7 @@ class MySqlPlatform extends AbstractPlatform
*/
*/
protected
function
getPostAlterTableRenameIndexForeignKeySQL
(
TableDiff
$diff
)
protected
function
getPostAlterTableRenameIndexForeignKeySQL
(
TableDiff
$diff
)
{
{
$sql
=
array
()
;
$sql
=
[]
;
$tableName
=
(
false
!==
$diff
->
newName
)
$tableName
=
(
false
!==
$diff
->
newName
)
?
$diff
->
getNewName
()
->
getQuotedName
(
$this
)
?
$diff
->
getNewName
()
->
getQuotedName
(
$this
)
:
$diff
->
getName
(
$this
)
->
getQuotedName
(
$this
);
:
$diff
->
getName
(
$this
)
->
getQuotedName
(
$this
);
...
@@ -1015,7 +1015,7 @@ class MySqlPlatform extends AbstractPlatform
...
@@ -1015,7 +1015,7 @@ class MySqlPlatform extends AbstractPlatform
*/
*/
protected
function
initializeDoctrineTypeMappings
()
protected
function
initializeDoctrineTypeMappings
()
{
{
$this
->
doctrineTypeMapping
=
array
(
$this
->
doctrineTypeMapping
=
[
'tinyint'
=>
'boolean'
,
'tinyint'
=>
'boolean'
,
'smallint'
=>
'smallint'
,
'smallint'
=>
'smallint'
,
'mediumint'
=>
'integer'
,
'mediumint'
=>
'integer'
,
...
@@ -1046,7 +1046,7 @@ class MySqlPlatform extends AbstractPlatform
...
@@ -1046,7 +1046,7 @@ class MySqlPlatform extends AbstractPlatform
'binary'
=>
'binary'
,
'binary'
=>
'binary'
,
'varbinary'
=>
'binary'
,
'varbinary'
=>
'binary'
,
'set'
=>
'simple_array'
,
'set'
=>
'simple_array'
,
)
;
]
;
}
}
/**
/**
...
...
lib/Doctrine/DBAL/Platforms/OraclePlatform.php
View file @
80f42dc7
...
@@ -384,10 +384,10 @@ class OraclePlatform extends AbstractPlatform
...
@@ -384,10 +384,10 @@ class OraclePlatform extends AbstractPlatform
/**
/**
* {@inheritDoc}
* {@inheritDoc}
*/
*/
protected
function
_getCreateTableSQL
(
$table
,
array
$columns
,
array
$options
=
array
()
)
protected
function
_getCreateTableSQL
(
$table
,
array
$columns
,
array
$options
=
[]
)
{
{
$indexes
=
isset
(
$options
[
'indexes'
])
?
$options
[
'indexes'
]
:
array
()
;
$indexes
=
isset
(
$options
[
'indexes'
])
?
$options
[
'indexes'
]
:
[]
;
$options
[
'indexes'
]
=
array
()
;
$options
[
'indexes'
]
=
[]
;
$sql
=
parent
::
_getCreateTableSQL
(
$table
,
$columns
,
$options
);
$sql
=
parent
::
_getCreateTableSQL
(
$table
,
$columns
,
$options
);
foreach
(
$columns
as
$name
=>
$column
)
{
foreach
(
$columns
as
$name
=>
$column
)
{
...
@@ -499,11 +499,11 @@ class OraclePlatform extends AbstractPlatform
...
@@ -499,11 +499,11 @@ class OraclePlatform extends AbstractPlatform
$quotedName
=
$nameIdentifier
->
getQuotedName
(
$this
);
$quotedName
=
$nameIdentifier
->
getQuotedName
(
$this
);
$unquotedName
=
$nameIdentifier
->
getName
();
$unquotedName
=
$nameIdentifier
->
getName
();
$sql
=
array
()
;
$sql
=
[]
;
$autoincrementIdentifierName
=
$this
->
getAutoincrementIdentifierName
(
$tableIdentifier
);
$autoincrementIdentifierName
=
$this
->
getAutoincrementIdentifierName
(
$tableIdentifier
);
$idx
=
new
Index
(
$autoincrementIdentifierName
,
array
(
$quotedName
)
,
true
,
true
);
$idx
=
new
Index
(
$autoincrementIdentifierName
,
[
$quotedName
]
,
true
,
true
);
$sql
[]
=
'DECLARE
$sql
[]
=
'DECLARE
constraints_Count NUMBER;
constraints_Count NUMBER;
...
@@ -562,11 +562,11 @@ END;';
...
@@ -562,11 +562,11 @@ END;';
''
''
);
);
return
array
(
return
[
'DROP TRIGGER '
.
$autoincrementIdentifierName
,
'DROP TRIGGER '
.
$autoincrementIdentifierName
,
$this
->
getDropSequenceSQL
(
$identitySequenceName
),
$this
->
getDropSequenceSQL
(
$identitySequenceName
),
$this
->
getDropConstraintSQL
(
$autoincrementIdentifierName
,
$table
->
getQuotedName
(
$this
)),
$this
->
getDropConstraintSQL
(
$autoincrementIdentifierName
,
$table
->
getQuotedName
(
$this
)),
)
;
]
;
}
}
/**
/**
...
@@ -764,11 +764,11 @@ END;';
...
@@ -764,11 +764,11 @@ END;';
*/
*/
public
function
getAlterTableSQL
(
TableDiff
$diff
)
public
function
getAlterTableSQL
(
TableDiff
$diff
)
{
{
$sql
=
array
()
;
$sql
=
[]
;
$commentsSQL
=
array
()
;
$commentsSQL
=
[]
;
$columnSql
=
array
()
;
$columnSql
=
[]
;
$fields
=
array
()
;
$fields
=
[]
;
foreach
(
$diff
->
addedColumns
as
$column
)
{
foreach
(
$diff
->
addedColumns
as
$column
)
{
if
(
$this
->
onSchemaAlterTableAddColumn
(
$column
,
$diff
,
$columnSql
))
{
if
(
$this
->
onSchemaAlterTableAddColumn
(
$column
,
$diff
,
$columnSql
))
{
...
@@ -789,7 +789,7 @@ END;';
...
@@ -789,7 +789,7 @@ END;';
$sql
[]
=
'ALTER TABLE '
.
$diff
->
getName
(
$this
)
->
getQuotedName
(
$this
)
.
' ADD ('
.
implode
(
', '
,
$fields
)
.
')'
;
$sql
[]
=
'ALTER TABLE '
.
$diff
->
getName
(
$this
)
->
getQuotedName
(
$this
)
.
' ADD ('
.
implode
(
', '
,
$fields
)
.
')'
;
}
}
$fields
=
array
()
;
$fields
=
[]
;
foreach
(
$diff
->
changedColumns
as
$columnDiff
)
{
foreach
(
$diff
->
changedColumns
as
$columnDiff
)
{
if
(
$this
->
onSchemaAlterTableChangeColumn
(
$columnDiff
,
$diff
,
$columnSql
))
{
if
(
$this
->
onSchemaAlterTableChangeColumn
(
$columnDiff
,
$diff
,
$columnSql
))
{
continue
;
continue
;
...
@@ -847,7 +847,7 @@ END;';
...
@@ -847,7 +847,7 @@ END;';
' RENAME COLUMN '
.
$oldColumnName
->
getQuotedName
(
$this
)
.
' TO '
.
$column
->
getQuotedName
(
$this
);
' RENAME COLUMN '
.
$oldColumnName
->
getQuotedName
(
$this
)
.
' TO '
.
$column
->
getQuotedName
(
$this
);
}
}
$fields
=
array
()
;
$fields
=
[]
;
foreach
(
$diff
->
removedColumns
as
$column
)
{
foreach
(
$diff
->
removedColumns
as
$column
)
{
if
(
$this
->
onSchemaAlterTableRemoveColumn
(
$column
,
$diff
,
$columnSql
))
{
if
(
$this
->
onSchemaAlterTableRemoveColumn
(
$column
,
$diff
,
$columnSql
))
{
continue
;
continue
;
...
@@ -860,7 +860,7 @@ END;';
...
@@ -860,7 +860,7 @@ END;';
$sql
[]
=
'ALTER TABLE '
.
$diff
->
getName
(
$this
)
->
getQuotedName
(
$this
)
.
' DROP ('
.
implode
(
', '
,
$fields
)
.
')'
;
$sql
[]
=
'ALTER TABLE '
.
$diff
->
getName
(
$this
)
->
getQuotedName
(
$this
)
.
' DROP ('
.
implode
(
', '
,
$fields
)
.
')'
;
}
}
$tableSql
=
array
()
;
$tableSql
=
[]
;
if
(
!
$this
->
onSchemaAlterTable
(
$diff
,
$tableSql
))
{
if
(
!
$this
->
onSchemaAlterTable
(
$diff
,
$tableSql
))
{
$sql
=
array_merge
(
$sql
,
$commentsSQL
);
$sql
=
array_merge
(
$sql
,
$commentsSQL
);
...
@@ -918,7 +918,7 @@ END;';
...
@@ -918,7 +918,7 @@ END;';
$oldIndexName
=
$schema
.
'.'
.
$oldIndexName
;
$oldIndexName
=
$schema
.
'.'
.
$oldIndexName
;
}
}
return
array
(
'ALTER INDEX '
.
$oldIndexName
.
' RENAME TO '
.
$index
->
getQuotedName
(
$this
))
;
return
[
'ALTER INDEX '
.
$oldIndexName
.
' RENAME TO '
.
$index
->
getQuotedName
(
$this
)]
;
}
}
/**
/**
...
@@ -986,7 +986,7 @@ END;';
...
@@ -986,7 +986,7 @@ END;';
$query
.=
" FROM dual"
;
$query
.=
" FROM dual"
;
}
}
$columns
=
array
(
'a.*'
)
;
$columns
=
[
'a.*'
]
;
if
(
$offset
>
0
)
{
if
(
$offset
>
0
)
{
$columns
[]
=
'ROWNUM AS doctrine_rownum'
;
$columns
[]
=
'ROWNUM AS doctrine_rownum'
;
...
@@ -1116,7 +1116,7 @@ END;';
...
@@ -1116,7 +1116,7 @@ END;';
*/
*/
protected
function
initializeDoctrineTypeMappings
()
protected
function
initializeDoctrineTypeMappings
()
{
{
$this
->
doctrineTypeMapping
=
array
(
$this
->
doctrineTypeMapping
=
[
'integer'
=>
'integer'
,
'integer'
=>
'integer'
,
'number'
=>
'integer'
,
'number'
=>
'integer'
,
'pls_integer'
=>
'boolean'
,
'pls_integer'
=>
'boolean'
,
...
@@ -1140,7 +1140,7 @@ END;';
...
@@ -1140,7 +1140,7 @@ END;';
'rowid'
=>
'string'
,
'rowid'
=>
'string'
,
'urowid'
=>
'string'
,
'urowid'
=>
'string'
,
'blob'
=>
'blob'
,
'blob'
=>
'blob'
,
)
;
]
;
}
}
/**
/**
...
...
lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php
View file @
80f42dc7
...
@@ -47,24 +47,24 @@ class PostgreSqlPlatform extends AbstractPlatform
...
@@ -47,24 +47,24 @@ class PostgreSqlPlatform extends AbstractPlatform
/**
/**
* @var array PostgreSQL booleans literals
* @var array PostgreSQL booleans literals
*/
*/
private
$booleanLiterals
=
array
(
private
$booleanLiterals
=
[
'true'
=>
array
(
'true'
=>
[
't'
,
't'
,
'true'
,
'true'
,
'y'
,
'y'
,
'yes'
,
'yes'
,
'on'
,
'on'
,
'1'
'1'
)
,
]
,
'false'
=>
array
(
'false'
=>
[
'f'
,
'f'
,
'false'
,
'false'
,
'n'
,
'n'
,
'no'
,
'no'
,
'off'
,
'off'
,
'0'
'0'
)
]
)
;
]
;
/**
/**
* PostgreSQL has different behavior with some drivers
* PostgreSQL has different behavior with some drivers
...
@@ -486,9 +486,9 @@ class PostgreSqlPlatform extends AbstractPlatform
...
@@ -486,9 +486,9 @@ class PostgreSqlPlatform extends AbstractPlatform
*/
*/
public
function
getAlterTableSQL
(
TableDiff
$diff
)
public
function
getAlterTableSQL
(
TableDiff
$diff
)
{
{
$sql
=
array
()
;
$sql
=
[]
;
$commentsSQL
=
array
()
;
$commentsSQL
=
[]
;
$columnSql
=
array
()
;
$columnSql
=
[]
;
foreach
(
$diff
->
addedColumns
as
$column
)
{
foreach
(
$diff
->
addedColumns
as
$column
)
{
if
(
$this
->
onSchemaAlterTableAddColumn
(
$column
,
$diff
,
$columnSql
))
{
if
(
$this
->
onSchemaAlterTableAddColumn
(
$column
,
$diff
,
$columnSql
))
{
...
@@ -593,7 +593,7 @@ class PostgreSqlPlatform extends AbstractPlatform
...
@@ -593,7 +593,7 @@ class PostgreSqlPlatform extends AbstractPlatform
' RENAME COLUMN '
.
$oldColumnName
->
getQuotedName
(
$this
)
.
' TO '
.
$column
->
getQuotedName
(
$this
);
' RENAME COLUMN '
.
$oldColumnName
->
getQuotedName
(
$this
)
.
' TO '
.
$column
->
getQuotedName
(
$this
);
}
}
$tableSql
=
array
()
;
$tableSql
=
[]
;
if
(
!
$this
->
onSchemaAlterTable
(
$diff
,
$tableSql
))
{
if
(
!
$this
->
onSchemaAlterTable
(
$diff
,
$tableSql
))
{
$sql
=
array_merge
(
$sql
,
$commentsSQL
);
$sql
=
array_merge
(
$sql
,
$commentsSQL
);
...
@@ -643,14 +643,14 @@ class PostgreSqlPlatform extends AbstractPlatform
...
@@ -643,14 +643,14 @@ class PostgreSqlPlatform extends AbstractPlatform
return
false
;
return
false
;
}
}
return
count
(
array_diff
(
$columnDiff
->
changedProperties
,
array
(
'type'
,
'length'
,
'fixed'
)
))
===
0
;
return
count
(
array_diff
(
$columnDiff
->
changedProperties
,
[
'type'
,
'length'
,
'fixed'
]
))
===
0
;
}
}
if
(
$columnDiff
->
hasChanged
(
'type'
))
{
if
(
$columnDiff
->
hasChanged
(
'type'
))
{
return
false
;
return
false
;
}
}
return
count
(
array_diff
(
$columnDiff
->
changedProperties
,
array
(
'length'
,
'fixed'
)
))
===
0
;
return
count
(
array_diff
(
$columnDiff
->
changedProperties
,
[
'length'
,
'fixed'
]
))
===
0
;
}
}
/**
/**
...
@@ -663,7 +663,7 @@ class PostgreSqlPlatform extends AbstractPlatform
...
@@ -663,7 +663,7 @@ class PostgreSqlPlatform extends AbstractPlatform
$oldIndexName
=
$schema
.
'.'
.
$oldIndexName
;
$oldIndexName
=
$schema
.
'.'
.
$oldIndexName
;
}
}
return
array
(
'ALTER INDEX '
.
$oldIndexName
.
' RENAME TO '
.
$index
->
getQuotedName
(
$this
))
;
return
[
'ALTER INDEX '
.
$oldIndexName
.
' RENAME TO '
.
$index
->
getQuotedName
(
$this
)]
;
}
}
/**
/**
...
@@ -748,7 +748,7 @@ class PostgreSqlPlatform extends AbstractPlatform
...
@@ -748,7 +748,7 @@ class PostgreSqlPlatform extends AbstractPlatform
/**
/**
* {@inheritDoc}
* {@inheritDoc}
*/
*/
protected
function
_getCreateTableSQL
(
$tableName
,
array
$columns
,
array
$options
=
array
()
)
protected
function
_getCreateTableSQL
(
$tableName
,
array
$columns
,
array
$options
=
[]
)
{
{
$queryFields
=
$this
->
getColumnDeclarationListSQL
(
$columns
);
$queryFields
=
$this
->
getColumnDeclarationListSQL
(
$columns
);
...
@@ -1094,7 +1094,7 @@ class PostgreSqlPlatform extends AbstractPlatform
...
@@ -1094,7 +1094,7 @@ class PostgreSqlPlatform extends AbstractPlatform
*/
*/
protected
function
initializeDoctrineTypeMappings
()
protected
function
initializeDoctrineTypeMappings
()
{
{
$this
->
doctrineTypeMapping
=
array
(
$this
->
doctrineTypeMapping
=
[
'smallint'
=>
'smallint'
,
'smallint'
=>
'smallint'
,
'int2'
=>
'smallint'
,
'int2'
=>
'smallint'
,
'serial'
=>
'integer'
,
'serial'
=>
'integer'
,
...
@@ -1134,7 +1134,7 @@ class PostgreSqlPlatform extends AbstractPlatform
...
@@ -1134,7 +1134,7 @@ class PostgreSqlPlatform extends AbstractPlatform
'year'
=>
'date'
,
'year'
=>
'date'
,
'uuid'
=>
'guid'
,
'uuid'
=>
'guid'
,
'bytea'
=>
'blob'
,
'bytea'
=>
'blob'
,
)
;
]
;
}
}
/**
/**
...
...
lib/Doctrine/DBAL/Platforms/SQLAnywherePlatform.php
View file @
80f42dc7
...
@@ -127,11 +127,11 @@ class SQLAnywherePlatform extends AbstractPlatform
...
@@ -127,11 +127,11 @@ class SQLAnywherePlatform extends AbstractPlatform
*/
*/
public
function
getAlterTableSQL
(
TableDiff
$diff
)
public
function
getAlterTableSQL
(
TableDiff
$diff
)
{
{
$sql
=
array
()
;
$sql
=
[]
;
$columnSql
=
array
()
;
$columnSql
=
[]
;
$commentsSQL
=
array
()
;
$commentsSQL
=
[]
;
$tableSql
=
array
()
;
$tableSql
=
[]
;
$alterClauses
=
array
()
;
$alterClauses
=
[]
;
/** @var \Doctrine\DBAL\Schema\Column $column */
/** @var \Doctrine\DBAL\Schema\Column $column */
foreach
(
$diff
->
addedColumns
as
$column
)
{
foreach
(
$diff
->
addedColumns
as
$column
)
{
...
@@ -1221,10 +1221,10 @@ class SQLAnywherePlatform extends AbstractPlatform
...
@@ -1221,10 +1221,10 @@ class SQLAnywherePlatform extends AbstractPlatform
/**
/**
* {@inheritdoc}
* {@inheritdoc}
*/
*/
protected
function
_getCreateTableSQL
(
$tableName
,
array
$columns
,
array
$options
=
array
()
)
protected
function
_getCreateTableSQL
(
$tableName
,
array
$columns
,
array
$options
=
[]
)
{
{
$columnListSql
=
$this
->
getColumnDeclarationListSQL
(
$columns
);
$columnListSql
=
$this
->
getColumnDeclarationListSQL
(
$columns
);
$indexSql
=
array
()
;
$indexSql
=
[]
;
if
(
!
empty
(
$options
[
'uniqueConstraints'
]))
{
if
(
!
empty
(
$options
[
'uniqueConstraints'
]))
{
foreach
((
array
)
$options
[
'uniqueConstraints'
]
as
$name
=>
$definition
)
{
foreach
((
array
)
$options
[
'uniqueConstraints'
]
as
$name
=>
$definition
)
{
...
@@ -1264,7 +1264,7 @@ class SQLAnywherePlatform extends AbstractPlatform
...
@@ -1264,7 +1264,7 @@ class SQLAnywherePlatform extends AbstractPlatform
$query
.=
')'
;
$query
.=
')'
;
return
array_merge
(
array
(
$query
)
,
$indexSql
);
return
array_merge
(
[
$query
]
,
$indexSql
);
}
}
/**
/**
...
@@ -1419,9 +1419,9 @@ class SQLAnywherePlatform extends AbstractPlatform
...
@@ -1419,9 +1419,9 @@ class SQLAnywherePlatform extends AbstractPlatform
*/
*/
protected
function
getRenameIndexSQL
(
$oldIndexName
,
Index
$index
,
$tableName
)
protected
function
getRenameIndexSQL
(
$oldIndexName
,
Index
$index
,
$tableName
)
{
{
return
array
(
return
[
'ALTER INDEX '
.
$oldIndexName
.
' ON '
.
$tableName
.
' RENAME TO '
.
$index
->
getQuotedName
(
$this
)
'ALTER INDEX '
.
$oldIndexName
.
' ON '
.
$tableName
.
' RENAME TO '
.
$index
->
getQuotedName
(
$this
)
)
;
]
;
}
}
/**
/**
...
@@ -1447,7 +1447,7 @@ class SQLAnywherePlatform extends AbstractPlatform
...
@@ -1447,7 +1447,7 @@ class SQLAnywherePlatform extends AbstractPlatform
*/
*/
protected
function
initializeDoctrineTypeMappings
()
protected
function
initializeDoctrineTypeMappings
()
{
{
$this
->
doctrineTypeMapping
=
array
(
$this
->
doctrineTypeMapping
=
[
'char'
=>
'string'
,
'char'
=>
'string'
,
'long nvarchar'
=>
'text'
,
'long nvarchar'
=>
'text'
,
'long varchar'
=>
'text'
,
'long varchar'
=>
'text'
,
...
@@ -1486,6 +1486,6 @@ class SQLAnywherePlatform extends AbstractPlatform
...
@@ -1486,6 +1486,6 @@ class SQLAnywherePlatform extends AbstractPlatform
'long binary'
=>
'blob'
,
'long binary'
=>
'blob'
,
'uniqueidentifier'
=>
'guid'
,
'uniqueidentifier'
=>
'guid'
,
'varbinary'
=>
'binary'
,
'varbinary'
=>
'binary'
,
)
;
]
;
}
}
}
}
lib/Doctrine/DBAL/Platforms/SQLServer2012Platform.php
View file @
80f42dc7
...
@@ -116,7 +116,7 @@ class SQLServer2012Platform extends SQLServer2008Platform
...
@@ -116,7 +116,7 @@ class SQLServer2012Platform extends SQLServer2008Platform
// Queries using OFFSET... FETCH MUST have an ORDER BY clause
// Queries using OFFSET... FETCH MUST have an ORDER BY clause
// Find the position of the last instance of ORDER BY and ensure it is not within a parenthetical statement
// Find the position of the last instance of ORDER BY and ensure it is not within a parenthetical statement
// but can be in a newline
// but can be in a newline
$matches
=
array
()
;
$matches
=
[]
;
$matchesCount
=
preg_match_all
(
"/[
\\
s]+order
\\
s+by
\\
s/im"
,
$query
,
$matches
,
PREG_OFFSET_CAPTURE
);
$matchesCount
=
preg_match_all
(
"/[
\\
s]+order
\\
s+by
\\
s/im"
,
$query
,
$matches
,
PREG_OFFSET_CAPTURE
);
$orderByPos
=
false
;
$orderByPos
=
false
;
if
(
$matchesCount
>
0
)
{
if
(
$matchesCount
>
0
)
{
...
...
lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php
View file @
80f42dc7
...
@@ -231,10 +231,10 @@ class SQLServerPlatform extends AbstractPlatform
...
@@ -231,10 +231,10 @@ class SQLServerPlatform extends AbstractPlatform
/**
/**
* {@inheritDoc}
* {@inheritDoc}
*/
*/
protected
function
_getCreateTableSQL
(
$tableName
,
array
$columns
,
array
$options
=
array
()
)
protected
function
_getCreateTableSQL
(
$tableName
,
array
$columns
,
array
$options
=
[]
)
{
{
$defaultConstraintsSql
=
array
()
;
$defaultConstraintsSql
=
[]
;
$commentsSql
=
array
()
;
$commentsSql
=
[]
;
// @todo does other code breaks because of this?
// @todo does other code breaks because of this?
// force primary keys to be not null
// force primary keys to be not null
...
@@ -419,7 +419,7 @@ class SQLServerPlatform extends AbstractPlatform
...
@@ -419,7 +419,7 @@ class SQLServerPlatform extends AbstractPlatform
*/
*/
private
function
_appendUniqueConstraintDefinition
(
$sql
,
Index
$index
)
private
function
_appendUniqueConstraintDefinition
(
$sql
,
Index
$index
)
{
{
$fields
=
array
()
;
$fields
=
[]
;
foreach
(
$index
->
getQuotedColumns
(
$this
)
as
$field
)
{
foreach
(
$index
->
getQuotedColumns
(
$this
)
as
$field
)
{
$fields
[]
=
$field
.
' IS NOT NULL'
;
$fields
[]
=
$field
.
' IS NOT NULL'
;
...
@@ -433,10 +433,10 @@ class SQLServerPlatform extends AbstractPlatform
...
@@ -433,10 +433,10 @@ class SQLServerPlatform extends AbstractPlatform
*/
*/
public
function
getAlterTableSQL
(
TableDiff
$diff
)
public
function
getAlterTableSQL
(
TableDiff
$diff
)
{
{
$queryParts
=
array
()
;
$queryParts
=
[]
;
$sql
=
array
()
;
$sql
=
[]
;
$columnSql
=
array
()
;
$columnSql
=
[]
;
$commentsSql
=
array
()
;
$commentsSql
=
[]
;
/** @var \Doctrine\DBAL\Schema\Column $column */
/** @var \Doctrine\DBAL\Schema\Column $column */
foreach
(
$diff
->
addedColumns
as
$column
)
{
foreach
(
$diff
->
addedColumns
as
$column
)
{
...
@@ -548,7 +548,7 @@ class SQLServerPlatform extends AbstractPlatform
...
@@ -548,7 +548,7 @@ class SQLServerPlatform extends AbstractPlatform
}
}
}
}
$tableSql
=
array
()
;
$tableSql
=
[]
;
if
(
$this
->
onSchemaAlterTable
(
$diff
,
$tableSql
))
{
if
(
$this
->
onSchemaAlterTable
(
$diff
,
$tableSql
))
{
return
array_merge
(
$tableSql
,
$columnSql
);
return
array_merge
(
$tableSql
,
$columnSql
);
...
@@ -725,14 +725,14 @@ class SQLServerPlatform extends AbstractPlatform
...
@@ -725,14 +725,14 @@ class SQLServerPlatform extends AbstractPlatform
*/
*/
protected
function
getRenameIndexSQL
(
$oldIndexName
,
Index
$index
,
$tableName
)
protected
function
getRenameIndexSQL
(
$oldIndexName
,
Index
$index
,
$tableName
)
{
{
return
array
(
return
[
sprintf
(
sprintf
(
"EXEC sp_RENAME N'%s.%s', N'%s', N'INDEX'"
,
"EXEC sp_RENAME N'%s.%s', N'%s', N'INDEX'"
,
$tableName
,
$tableName
,
$oldIndexName
,
$oldIndexName
,
$index
->
getQuotedName
(
$this
)
$index
->
getQuotedName
(
$this
)
)
)
)
;
]
;
}
}
/**
/**
...
@@ -1413,7 +1413,7 @@ class SQLServerPlatform extends AbstractPlatform
...
@@ -1413,7 +1413,7 @@ class SQLServerPlatform extends AbstractPlatform
*/
*/
protected
function
initializeDoctrineTypeMappings
()
protected
function
initializeDoctrineTypeMappings
()
{
{
$this
->
doctrineTypeMapping
=
array
(
$this
->
doctrineTypeMapping
=
[
'bigint'
=>
'bigint'
,
'bigint'
=>
'bigint'
,
'numeric'
=>
'decimal'
,
'numeric'
=>
'decimal'
,
'bit'
=>
'boolean'
,
'bit'
=>
'boolean'
,
...
@@ -1439,7 +1439,7 @@ class SQLServerPlatform extends AbstractPlatform
...
@@ -1439,7 +1439,7 @@ class SQLServerPlatform extends AbstractPlatform
'varbinary'
=>
'binary'
,
'varbinary'
=>
'binary'
,
'image'
=>
'blob'
,
'image'
=>
'blob'
,
'uniqueidentifier'
=>
'guid'
,
'uniqueidentifier'
=>
'guid'
,
)
;
]
;
}
}
/**
/**
...
@@ -1554,11 +1554,11 @@ class SQLServerPlatform extends AbstractPlatform
...
@@ -1554,11 +1554,11 @@ class SQLServerPlatform extends AbstractPlatform
return
" DEFAULT '"
.
$field
[
'default'
]
.
"'"
;
return
" DEFAULT '"
.
$field
[
'default'
]
.
"'"
;
}
}
if
(
in_array
((
string
)
$field
[
'type'
],
array
(
'Integer'
,
'BigInt'
,
'SmallInt'
)
))
{
if
(
in_array
((
string
)
$field
[
'type'
],
[
'Integer'
,
'BigInt'
,
'SmallInt'
]
))
{
return
" DEFAULT "
.
$field
[
'default'
];
return
" DEFAULT "
.
$field
[
'default'
];
}
}
if
(
in_array
((
string
)
$field
[
'type'
],
array
(
'DateTime'
,
'DateTimeTz'
)
)
&&
$field
[
'default'
]
==
$this
->
getCurrentTimestampSQL
())
{
if
(
in_array
((
string
)
$field
[
'type'
],
[
'DateTime'
,
'DateTimeTz'
]
)
&&
$field
[
'default'
]
==
$this
->
getCurrentTimestampSQL
())
{
return
" DEFAULT "
.
$this
->
getCurrentTimestampSQL
();
return
" DEFAULT "
.
$this
->
getCurrentTimestampSQL
();
}
}
...
...
lib/Doctrine/DBAL/Platforms/SqlitePlatform.php
View file @
80f42dc7
...
@@ -315,7 +315,7 @@ class SqlitePlatform extends AbstractPlatform
...
@@ -315,7 +315,7 @@ class SqlitePlatform extends AbstractPlatform
/**
/**
* {@inheritDoc}
* {@inheritDoc}
*/
*/
protected
function
_getCreateTableSQL
(
$name
,
array
$columns
,
array
$options
=
array
()
)
protected
function
_getCreateTableSQL
(
$name
,
array
$columns
,
array
$options
=
[]
)
{
{
$name
=
str_replace
(
'.'
,
'__'
,
$name
);
$name
=
str_replace
(
'.'
,
'__'
,
$name
);
$queryFields
=
$this
->
getColumnDeclarationListSQL
(
$columns
);
$queryFields
=
$this
->
getColumnDeclarationListSQL
(
$columns
);
...
@@ -592,7 +592,7 @@ class SqlitePlatform extends AbstractPlatform
...
@@ -592,7 +592,7 @@ class SqlitePlatform extends AbstractPlatform
*/
*/
protected
function
initializeDoctrineTypeMappings
()
protected
function
initializeDoctrineTypeMappings
()
{
{
$this
->
doctrineTypeMapping
=
array
(
$this
->
doctrineTypeMapping
=
[
'boolean'
=>
'boolean'
,
'boolean'
=>
'boolean'
,
'tinyint'
=>
'boolean'
,
'tinyint'
=>
'boolean'
,
'smallint'
=>
'smallint'
,
'smallint'
=>
'smallint'
,
...
@@ -625,7 +625,7 @@ class SqlitePlatform extends AbstractPlatform
...
@@ -625,7 +625,7 @@ class SqlitePlatform extends AbstractPlatform
'decimal'
=>
'decimal'
,
'decimal'
=>
'decimal'
,
'numeric'
=>
'decimal'
,
'numeric'
=>
'decimal'
,
'blob'
=>
'blob'
,
'blob'
=>
'blob'
,
)
;
]
;
}
}
/**
/**
...
@@ -645,7 +645,7 @@ class SqlitePlatform extends AbstractPlatform
...
@@ -645,7 +645,7 @@ class SqlitePlatform extends AbstractPlatform
throw
new
DBALException
(
'Sqlite platform requires for alter table the table diff with reference to original table schema'
);
throw
new
DBALException
(
'Sqlite platform requires for alter table the table diff with reference to original table schema'
);
}
}
$sql
=
array
()
;
$sql
=
[]
;
foreach
(
$diff
->
fromTable
->
getIndexes
()
as
$index
)
{
foreach
(
$diff
->
fromTable
->
getIndexes
()
as
$index
)
{
if
(
!
$index
->
isPrimary
())
{
if
(
!
$index
->
isPrimary
())
{
$sql
[]
=
$this
->
getDropIndexSQL
(
$index
,
$diff
->
name
);
$sql
[]
=
$this
->
getDropIndexSQL
(
$index
,
$diff
->
name
);
...
@@ -664,7 +664,7 @@ class SqlitePlatform extends AbstractPlatform
...
@@ -664,7 +664,7 @@ class SqlitePlatform extends AbstractPlatform
throw
new
DBALException
(
'Sqlite platform requires for alter table the table diff with reference to original table schema'
);
throw
new
DBALException
(
'Sqlite platform requires for alter table the table diff with reference to original table schema'
);
}
}
$sql
=
array
()
;
$sql
=
[]
;
$tableName
=
$diff
->
newName
?
$diff
->
getNewName
()
:
$diff
->
getName
(
$this
);
$tableName
=
$diff
->
newName
?
$diff
->
getNewName
()
:
$diff
->
getName
(
$this
);
foreach
(
$this
->
getIndexesInAlteredTable
(
$diff
)
as
$index
)
{
foreach
(
$this
->
getIndexesInAlteredTable
(
$diff
)
as
$index
)
{
if
(
$index
->
isPrimary
())
{
if
(
$index
->
isPrimary
())
{
...
@@ -799,10 +799,10 @@ class SqlitePlatform extends AbstractPlatform
...
@@ -799,10 +799,10 @@ class SqlitePlatform extends AbstractPlatform
$table
=
clone
$fromTable
;
$table
=
clone
$fromTable
;
$columns
=
array
()
;
$columns
=
[]
;
$oldColumnNames
=
array
()
;
$oldColumnNames
=
[]
;
$newColumnNames
=
array
()
;
$newColumnNames
=
[]
;
$columnSql
=
array
()
;
$columnSql
=
[]
;
foreach
(
$table
->
getColumns
()
as
$columnName
=>
$column
)
{
foreach
(
$table
->
getColumns
()
as
$columnName
=>
$column
)
{
$columnName
=
strtolower
(
$columnName
);
$columnName
=
strtolower
(
$columnName
);
...
@@ -864,8 +864,8 @@ class SqlitePlatform extends AbstractPlatform
...
@@ -864,8 +864,8 @@ class SqlitePlatform extends AbstractPlatform
$columns
[
strtolower
(
$columnName
)]
=
$column
;
$columns
[
strtolower
(
$columnName
)]
=
$column
;
}
}
$sql
=
array
()
;
$sql
=
[]
;
$tableSql
=
array
()
;
$tableSql
=
[]
;
if
(
!
$this
->
onSchemaAlterTable
(
$diff
,
$tableSql
))
{
if
(
!
$this
->
onSchemaAlterTable
(
$diff
,
$tableSql
))
{
$dataTable
=
new
Table
(
'__temp__'
.
$table
->
getName
());
$dataTable
=
new
Table
(
'__temp__'
.
$table
->
getName
());
...
@@ -932,16 +932,16 @@ class SqlitePlatform extends AbstractPlatform
...
@@ -932,16 +932,16 @@ class SqlitePlatform extends AbstractPlatform
$table
=
new
Table
(
$diff
->
name
);
$table
=
new
Table
(
$diff
->
name
);
$sql
=
array
()
;
$sql
=
[]
;
$tableSql
=
array
()
;
$tableSql
=
[]
;
$columnSql
=
array
()
;
$columnSql
=
[]
;
foreach
(
$diff
->
addedColumns
as
$column
)
{
foreach
(
$diff
->
addedColumns
as
$column
)
{
if
(
$this
->
onSchemaAlterTableAddColumn
(
$column
,
$diff
,
$columnSql
))
{
if
(
$this
->
onSchemaAlterTableAddColumn
(
$column
,
$diff
,
$columnSql
))
{
continue
;
continue
;
}
}
$field
=
array_merge
(
array
(
'unique'
=>
null
,
'autoincrement'
=>
null
,
'default'
=>
null
)
,
$column
->
toArray
());
$field
=
array_merge
(
[
'unique'
=>
null
,
'autoincrement'
=>
null
,
'default'
=>
null
]
,
$column
->
toArray
());
$type
=
(
string
)
$field
[
'type'
];
$type
=
(
string
)
$field
[
'type'
];
switch
(
true
)
{
switch
(
true
)
{
case
isset
(
$field
[
'columnDefinition'
])
||
$field
[
'autoincrement'
]
||
$field
[
'unique'
]
:
case
isset
(
$field
[
'columnDefinition'
])
||
$field
[
'autoincrement'
]
||
$field
[
'unique'
]
:
...
@@ -976,7 +976,7 @@ class SqlitePlatform extends AbstractPlatform
...
@@ -976,7 +976,7 @@ class SqlitePlatform extends AbstractPlatform
*/
*/
private
function
getColumnNamesInAlteredTable
(
TableDiff
$diff
)
private
function
getColumnNamesInAlteredTable
(
TableDiff
$diff
)
{
{
$columns
=
array
()
;
$columns
=
[]
;
foreach
(
$diff
->
fromTable
->
getColumns
()
as
$columnName
=>
$column
)
{
foreach
(
$diff
->
fromTable
->
getColumns
()
as
$columnName
=>
$column
)
{
$columns
[
strtolower
(
$columnName
)]
=
$column
->
getName
();
$columns
[
strtolower
(
$columnName
)]
=
$column
->
getName
();
...
@@ -1026,7 +1026,7 @@ class SqlitePlatform extends AbstractPlatform
...
@@ -1026,7 +1026,7 @@ class SqlitePlatform extends AbstractPlatform
}
}
$changed
=
false
;
$changed
=
false
;
$indexColumns
=
array
()
;
$indexColumns
=
[]
;
foreach
(
$index
->
getColumns
()
as
$columnName
)
{
foreach
(
$index
->
getColumns
()
as
$columnName
)
{
$normalizedColumnName
=
strtolower
(
$columnName
);
$normalizedColumnName
=
strtolower
(
$columnName
);
if
(
!
isset
(
$columnNames
[
$normalizedColumnName
]))
{
if
(
!
isset
(
$columnNames
[
$normalizedColumnName
]))
{
...
@@ -1076,7 +1076,7 @@ class SqlitePlatform extends AbstractPlatform
...
@@ -1076,7 +1076,7 @@ class SqlitePlatform extends AbstractPlatform
foreach
(
$foreignKeys
as
$key
=>
$constraint
)
{
foreach
(
$foreignKeys
as
$key
=>
$constraint
)
{
$changed
=
false
;
$changed
=
false
;
$localColumns
=
array
()
;
$localColumns
=
[]
;
foreach
(
$constraint
->
getLocalColumns
()
as
$columnName
)
{
foreach
(
$constraint
->
getLocalColumns
()
as
$columnName
)
{
$normalizedColumnName
=
strtolower
(
$columnName
);
$normalizedColumnName
=
strtolower
(
$columnName
);
if
(
!
isset
(
$columnNames
[
$normalizedColumnName
]))
{
if
(
!
isset
(
$columnNames
[
$normalizedColumnName
]))
{
...
@@ -1121,11 +1121,11 @@ class SqlitePlatform extends AbstractPlatform
...
@@ -1121,11 +1121,11 @@ class SqlitePlatform extends AbstractPlatform
*/
*/
private
function
getPrimaryIndexInAlteredTable
(
TableDiff
$diff
)
private
function
getPrimaryIndexInAlteredTable
(
TableDiff
$diff
)
{
{
$primaryIndex
=
array
()
;
$primaryIndex
=
[]
;
foreach
(
$this
->
getIndexesInAlteredTable
(
$diff
)
as
$index
)
{
foreach
(
$this
->
getIndexesInAlteredTable
(
$diff
)
as
$index
)
{
if
(
$index
->
isPrimary
())
{
if
(
$index
->
isPrimary
())
{
$primaryIndex
=
array
(
$index
->
getName
()
=>
$index
)
;
$primaryIndex
=
[
$index
->
getName
()
=>
$index
]
;
}
}
}
}
...
...
lib/Doctrine/DBAL/Portability/Connection.php
View file @
80f42dc7
...
@@ -115,7 +115,7 @@ class Connection extends \Doctrine\DBAL\Connection
...
@@ -115,7 +115,7 @@ class Connection extends \Doctrine\DBAL\Connection
/**
/**
* {@inheritdoc}
* {@inheritdoc}
*/
*/
public
function
executeQuery
(
$query
,
array
$params
=
array
(),
$types
=
array
()
,
QueryCacheProfile
$qcp
=
null
)
public
function
executeQuery
(
$query
,
array
$params
=
[],
$types
=
[]
,
QueryCacheProfile
$qcp
=
null
)
{
{
$stmt
=
new
Statement
(
parent
::
executeQuery
(
$query
,
$params
,
$types
,
$qcp
),
$this
);
$stmt
=
new
Statement
(
parent
::
executeQuery
(
$query
,
$params
,
$types
,
$qcp
),
$this
);
$stmt
->
setFetchMode
(
$this
->
defaultFetchMode
);
$stmt
->
setFetchMode
(
$this
->
defaultFetchMode
);
...
...
lib/Doctrine/DBAL/Portability/Statement.php
View file @
80f42dc7
...
@@ -177,7 +177,7 @@ class Statement implements \IteratorAggregate, \Doctrine\DBAL\Driver\Statement
...
@@ -177,7 +177,7 @@ class Statement implements \IteratorAggregate, \Doctrine\DBAL\Driver\Statement
if
(
$fetchMode
===
PDO
::
FETCH_COLUMN
)
{
if
(
$fetchMode
===
PDO
::
FETCH_COLUMN
)
{
foreach
(
$rows
as
$num
=>
$row
)
{
foreach
(
$rows
as
$num
=>
$row
)
{
$rows
[
$num
]
=
array
(
$row
)
;
$rows
[
$num
]
=
[
$row
]
;
}
}
}
}
...
...
lib/Doctrine/DBAL/Query/QueryBuilder.php
View file @
80f42dc7
...
@@ -420,7 +420,7 @@ class QueryBuilder
...
@@ -420,7 +420,7 @@ class QueryBuilder
$isMultiple
=
is_array
(
$this
->
sqlParts
[
$sqlPartName
]);
$isMultiple
=
is_array
(
$this
->
sqlParts
[
$sqlPartName
]);
if
(
$isMultiple
&&
!
$isArray
)
{
if
(
$isMultiple
&&
!
$isArray
)
{
$sqlPart
=
array
(
$sqlPart
)
;
$sqlPart
=
[
$sqlPart
]
;
}
}
$this
->
state
=
self
::
STATE_DIRTY
;
$this
->
state
=
self
::
STATE_DIRTY
;
...
@@ -1093,7 +1093,7 @@ class QueryBuilder
...
@@ -1093,7 +1093,7 @@ class QueryBuilder
public
function
resetQueryPart
(
$queryPartName
)
public
function
resetQueryPart
(
$queryPartName
)
{
{
$this
->
sqlParts
[
$queryPartName
]
=
is_array
(
$this
->
sqlParts
[
$queryPartName
])
$this
->
sqlParts
[
$queryPartName
]
=
is_array
(
$this
->
sqlParts
[
$queryPartName
])
?
array
()
:
null
;
?
[]
:
null
;
$this
->
state
=
self
::
STATE_DIRTY
;
$this
->
state
=
self
::
STATE_DIRTY
;
...
@@ -1131,8 +1131,8 @@ class QueryBuilder
...
@@ -1131,8 +1131,8 @@ class QueryBuilder
*/
*/
private
function
getFromClauses
()
private
function
getFromClauses
()
{
{
$fromClauses
=
array
()
;
$fromClauses
=
[]
;
$knownAliases
=
array
()
;
$knownAliases
=
[]
;
// Loop through all FROM clauses
// Loop through all FROM clauses
foreach
(
$this
->
sqlParts
[
'from'
]
as
$from
)
{
foreach
(
$this
->
sqlParts
[
'from'
]
as
$from
)
{
...
...
lib/Doctrine/DBAL/SQLParserUtils.php
View file @
80f42dc7
...
@@ -52,11 +52,11 @@ class SQLParserUtils
...
@@ -52,11 +52,11 @@ class SQLParserUtils
{
{
$match
=
(
$isPositional
)
?
'?'
:
':'
;
$match
=
(
$isPositional
)
?
'?'
:
':'
;
if
(
strpos
(
$statement
,
$match
)
===
false
)
{
if
(
strpos
(
$statement
,
$match
)
===
false
)
{
return
array
()
;
return
[]
;
}
}
$token
=
(
$isPositional
)
?
self
::
POSITIONAL_TOKEN
:
self
::
NAMED_TOKEN
;
$token
=
(
$isPositional
)
?
self
::
POSITIONAL_TOKEN
:
self
::
NAMED_TOKEN
;
$paramMap
=
array
()
;
$paramMap
=
[]
;
foreach
(
self
::
getUnquotedStatementFragments
(
$statement
)
as
$fragment
)
{
foreach
(
self
::
getUnquotedStatementFragments
(
$statement
)
as
$fragment
)
{
preg_match_all
(
"/
$token
/"
,
$fragment
[
0
],
$matches
,
PREG_OFFSET_CAPTURE
);
preg_match_all
(
"/
$token
/"
,
$fragment
[
0
],
$matches
,
PREG_OFFSET_CAPTURE
);
...
@@ -87,7 +87,7 @@ class SQLParserUtils
...
@@ -87,7 +87,7 @@ class SQLParserUtils
static
public
function
expandListParameters
(
$query
,
$params
,
$types
)
static
public
function
expandListParameters
(
$query
,
$params
,
$types
)
{
{
$isPositional
=
is_int
(
key
(
$params
));
$isPositional
=
is_int
(
key
(
$params
));
$arrayPositions
=
array
()
;
$arrayPositions
=
[]
;
$bindIndex
=
-
1
;
$bindIndex
=
-
1
;
if
(
$isPositional
)
{
if
(
$isPositional
)
{
...
@@ -110,7 +110,7 @@ class SQLParserUtils
...
@@ -110,7 +110,7 @@ class SQLParserUtils
}
}
if
((
!
$arrayPositions
&&
$isPositional
))
{
if
((
!
$arrayPositions
&&
$isPositional
))
{
return
array
(
$query
,
$params
,
$types
)
;
return
[
$query
,
$params
,
$types
]
;
}
}
$paramPos
=
self
::
getPlaceholderPositions
(
$query
,
$isPositional
);
$paramPos
=
self
::
getPlaceholderPositions
(
$query
,
$isPositional
);
...
@@ -140,7 +140,7 @@ class SQLParserUtils
...
@@ -140,7 +140,7 @@ class SQLParserUtils
array_slice
(
$types
,
0
,
$needle
),
array_slice
(
$types
,
0
,
$needle
),
$count
?
$count
?
array_fill
(
0
,
$count
,
$types
[
$needle
]
-
Connection
::
ARRAY_PARAM_OFFSET
)
:
// array needles are at PDO::PARAM_* + 100
array_fill
(
0
,
$count
,
$types
[
$needle
]
-
Connection
::
ARRAY_PARAM_OFFSET
)
:
// array needles are at PDO::PARAM_* + 100
array
()
,
[]
,
array_slice
(
$types
,
$needle
+
1
)
array_slice
(
$types
,
$needle
+
1
)
);
);
...
@@ -151,12 +151,12 @@ class SQLParserUtils
...
@@ -151,12 +151,12 @@ class SQLParserUtils
$queryOffset
+=
(
strlen
(
$expandStr
)
-
1
);
$queryOffset
+=
(
strlen
(
$expandStr
)
-
1
);
}
}
return
array
(
$query
,
$params
,
$types
)
;
return
[
$query
,
$params
,
$types
]
;
}
}
$queryOffset
=
0
;
$queryOffset
=
0
;
$typesOrd
=
array
()
;
$typesOrd
=
[]
;
$paramsOrd
=
array
()
;
$paramsOrd
=
[]
;
foreach
(
$paramPos
as
$pos
=>
$paramName
)
{
foreach
(
$paramPos
as
$pos
=>
$paramName
)
{
$paramLen
=
strlen
(
$paramName
)
+
1
;
$paramLen
=
strlen
(
$paramName
)
+
1
;
...
@@ -185,7 +185,7 @@ class SQLParserUtils
...
@@ -185,7 +185,7 @@ class SQLParserUtils
$query
=
substr
(
$query
,
0
,
$pos
)
.
$expandStr
.
substr
(
$query
,
(
$pos
+
$paramLen
));
$query
=
substr
(
$query
,
0
,
$pos
)
.
$expandStr
.
substr
(
$query
,
(
$pos
+
$paramLen
));
}
}
return
array
(
$query
,
$paramsOrd
,
$typesOrd
)
;
return
[
$query
,
$paramsOrd
,
$typesOrd
]
;
}
}
/**
/**
...
...
lib/Doctrine/DBAL/Schema/AbstractAsset.php
View file @
80f42dc7
...
@@ -167,7 +167,7 @@ abstract class AbstractAsset
...
@@ -167,7 +167,7 @@ abstract class AbstractAsset
*/
*/
protected
function
trimQuotes
(
$identifier
)
protected
function
trimQuotes
(
$identifier
)
{
{
return
str_replace
(
array
(
'`'
,
'"'
,
'['
,
']'
)
,
''
,
$identifier
);
return
str_replace
(
[
'`'
,
'"'
,
'['
,
']'
]
,
''
,
$identifier
);
}
}
/**
/**
...
...
lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php
View file @
80f42dc7
...
@@ -94,7 +94,7 @@ abstract class AbstractSchemaManager
...
@@ -94,7 +94,7 @@ abstract class AbstractSchemaManager
$args
=
array_values
(
$args
);
$args
=
array_values
(
$args
);
try
{
try
{
return
call_user_func_array
(
array
(
$this
,
$method
)
,
$args
);
return
call_user_func_array
(
[
$this
,
$method
]
,
$args
);
}
catch
(
\Exception
$e
)
{
}
catch
(
\Exception
$e
)
{
return
false
;
return
false
;
}
}
...
@@ -263,7 +263,7 @@ abstract class AbstractSchemaManager
...
@@ -263,7 +263,7 @@ abstract class AbstractSchemaManager
{
{
$tableNames
=
$this
->
listTableNames
();
$tableNames
=
$this
->
listTableNames
();
$tables
=
array
()
;
$tables
=
[]
;
foreach
(
$tableNames
as
$tableName
)
{
foreach
(
$tableNames
as
$tableName
)
{
$tables
[]
=
$this
->
listTableDetails
(
$tableName
);
$tables
[]
=
$this
->
listTableDetails
(
$tableName
);
}
}
...
@@ -279,13 +279,13 @@ abstract class AbstractSchemaManager
...
@@ -279,13 +279,13 @@ abstract class AbstractSchemaManager
public
function
listTableDetails
(
$tableName
)
public
function
listTableDetails
(
$tableName
)
{
{
$columns
=
$this
->
listTableColumns
(
$tableName
);
$columns
=
$this
->
listTableColumns
(
$tableName
);
$foreignKeys
=
array
()
;
$foreignKeys
=
[]
;
if
(
$this
->
_platform
->
supportsForeignKeyConstraints
())
{
if
(
$this
->
_platform
->
supportsForeignKeyConstraints
())
{
$foreignKeys
=
$this
->
listTableForeignKeys
(
$tableName
);
$foreignKeys
=
$this
->
listTableForeignKeys
(
$tableName
);
}
}
$indexes
=
$this
->
listTableIndexes
(
$tableName
);
$indexes
=
$this
->
listTableIndexes
(
$tableName
);
return
new
Table
(
$tableName
,
$columns
,
$indexes
,
$foreignKeys
,
false
,
array
()
);
return
new
Table
(
$tableName
,
$columns
,
$indexes
,
$foreignKeys
,
false
,
[]
);
}
}
/**
/**
...
@@ -655,7 +655,7 @@ abstract class AbstractSchemaManager
...
@@ -655,7 +655,7 @@ abstract class AbstractSchemaManager
*/
*/
protected
function
_getPortableDatabasesList
(
$databases
)
protected
function
_getPortableDatabasesList
(
$databases
)
{
{
$list
=
array
()
;
$list
=
[]
;
foreach
(
$databases
as
$value
)
{
foreach
(
$databases
as
$value
)
{
if
(
$value
=
$this
->
_getPortableDatabaseDefinition
(
$value
))
{
if
(
$value
=
$this
->
_getPortableDatabaseDefinition
(
$value
))
{
$list
[]
=
$value
;
$list
[]
=
$value
;
...
@@ -674,7 +674,7 @@ abstract class AbstractSchemaManager
...
@@ -674,7 +674,7 @@ abstract class AbstractSchemaManager
*/
*/
protected
function
getPortableNamespacesList
(
array
$namespaces
)
protected
function
getPortableNamespacesList
(
array
$namespaces
)
{
{
$namespacesList
=
array
()
;
$namespacesList
=
[]
;
foreach
(
$namespaces
as
$namespace
)
{
foreach
(
$namespaces
as
$namespace
)
{
$namespacesList
[]
=
$this
->
getPortableNamespaceDefinition
(
$namespace
);
$namespacesList
[]
=
$this
->
getPortableNamespaceDefinition
(
$namespace
);
...
@@ -712,7 +712,7 @@ abstract class AbstractSchemaManager
...
@@ -712,7 +712,7 @@ abstract class AbstractSchemaManager
*/
*/
protected
function
_getPortableFunctionsList
(
$functions
)
protected
function
_getPortableFunctionsList
(
$functions
)
{
{
$list
=
array
()
;
$list
=
[]
;
foreach
(
$functions
as
$value
)
{
foreach
(
$functions
as
$value
)
{
if
(
$value
=
$this
->
_getPortableFunctionDefinition
(
$value
))
{
if
(
$value
=
$this
->
_getPortableFunctionDefinition
(
$value
))
{
$list
[]
=
$value
;
$list
[]
=
$value
;
...
@@ -739,7 +739,7 @@ abstract class AbstractSchemaManager
...
@@ -739,7 +739,7 @@ abstract class AbstractSchemaManager
*/
*/
protected
function
_getPortableTriggersList
(
$triggers
)
protected
function
_getPortableTriggersList
(
$triggers
)
{
{
$list
=
array
()
;
$list
=
[]
;
foreach
(
$triggers
as
$value
)
{
foreach
(
$triggers
as
$value
)
{
if
(
$value
=
$this
->
_getPortableTriggerDefinition
(
$value
))
{
if
(
$value
=
$this
->
_getPortableTriggerDefinition
(
$value
))
{
$list
[]
=
$value
;
$list
[]
=
$value
;
...
@@ -766,7 +766,7 @@ abstract class AbstractSchemaManager
...
@@ -766,7 +766,7 @@ abstract class AbstractSchemaManager
*/
*/
protected
function
_getPortableSequencesList
(
$sequences
)
protected
function
_getPortableSequencesList
(
$sequences
)
{
{
$list
=
array
()
;
$list
=
[]
;
foreach
(
$sequences
as
$value
)
{
foreach
(
$sequences
as
$value
)
{
if
(
$value
=
$this
->
_getPortableSequenceDefinition
(
$value
))
{
if
(
$value
=
$this
->
_getPortableSequenceDefinition
(
$value
))
{
$list
[]
=
$value
;
$list
[]
=
$value
;
...
@@ -803,7 +803,7 @@ abstract class AbstractSchemaManager
...
@@ -803,7 +803,7 @@ abstract class AbstractSchemaManager
{
{
$eventManager
=
$this
->
_platform
->
getEventManager
();
$eventManager
=
$this
->
_platform
->
getEventManager
();
$list
=
array
()
;
$list
=
[]
;
foreach
(
$tableColumns
as
$tableColumn
)
{
foreach
(
$tableColumns
as
$tableColumn
)
{
$column
=
null
;
$column
=
null
;
$defaultPrevented
=
false
;
$defaultPrevented
=
false
;
...
@@ -848,7 +848,7 @@ abstract class AbstractSchemaManager
...
@@ -848,7 +848,7 @@ abstract class AbstractSchemaManager
*/
*/
protected
function
_getPortableTableIndexesList
(
$tableIndexRows
,
$tableName
=
null
)
protected
function
_getPortableTableIndexesList
(
$tableIndexRows
,
$tableName
=
null
)
{
{
$result
=
array
()
;
$result
=
[]
;
foreach
(
$tableIndexRows
as
$tableIndex
)
{
foreach
(
$tableIndexRows
as
$tableIndex
)
{
$indexName
=
$keyName
=
$tableIndex
[
'key_name'
];
$indexName
=
$keyName
=
$tableIndex
[
'key_name'
];
if
(
$tableIndex
[
'primary'
])
{
if
(
$tableIndex
[
'primary'
])
{
...
@@ -857,14 +857,14 @@ abstract class AbstractSchemaManager
...
@@ -857,14 +857,14 @@ abstract class AbstractSchemaManager
$keyName
=
strtolower
(
$keyName
);
$keyName
=
strtolower
(
$keyName
);
if
(
!
isset
(
$result
[
$keyName
]))
{
if
(
!
isset
(
$result
[
$keyName
]))
{
$result
[
$keyName
]
=
array
(
$result
[
$keyName
]
=
[
'name'
=>
$indexName
,
'name'
=>
$indexName
,
'columns'
=>
array
(
$tableIndex
[
'column_name'
])
,
'columns'
=>
[
$tableIndex
[
'column_name'
]]
,
'unique'
=>
$tableIndex
[
'non_unique'
]
?
false
:
true
,
'unique'
=>
$tableIndex
[
'non_unique'
]
?
false
:
true
,
'primary'
=>
$tableIndex
[
'primary'
],
'primary'
=>
$tableIndex
[
'primary'
],
'flags'
=>
isset
(
$tableIndex
[
'flags'
])
?
$tableIndex
[
'flags'
]
:
array
()
,
'flags'
=>
isset
(
$tableIndex
[
'flags'
])
?
$tableIndex
[
'flags'
]
:
[]
,
'options'
=>
isset
(
$tableIndex
[
'where'
])
?
array
(
'where'
=>
$tableIndex
[
'where'
])
:
array
()
,
'options'
=>
isset
(
$tableIndex
[
'where'
])
?
[
'where'
=>
$tableIndex
[
'where'
]]
:
[]
,
)
;
]
;
}
else
{
}
else
{
$result
[
$keyName
][
'columns'
][]
=
$tableIndex
[
'column_name'
];
$result
[
$keyName
][
'columns'
][]
=
$tableIndex
[
'column_name'
];
}
}
...
@@ -872,7 +872,7 @@ abstract class AbstractSchemaManager
...
@@ -872,7 +872,7 @@ abstract class AbstractSchemaManager
$eventManager
=
$this
->
_platform
->
getEventManager
();
$eventManager
=
$this
->
_platform
->
getEventManager
();
$indexes
=
array
()
;
$indexes
=
[]
;
foreach
(
$result
as
$indexKey
=>
$data
)
{
foreach
(
$result
as
$indexKey
=>
$data
)
{
$index
=
null
;
$index
=
null
;
$defaultPrevented
=
false
;
$defaultPrevented
=
false
;
...
@@ -904,7 +904,7 @@ abstract class AbstractSchemaManager
...
@@ -904,7 +904,7 @@ abstract class AbstractSchemaManager
*/
*/
protected
function
_getPortableTablesList
(
$tables
)
protected
function
_getPortableTablesList
(
$tables
)
{
{
$list
=
array
()
;
$list
=
[]
;
foreach
(
$tables
as
$value
)
{
foreach
(
$tables
as
$value
)
{
if
(
$value
=
$this
->
_getPortableTableDefinition
(
$value
))
{
if
(
$value
=
$this
->
_getPortableTableDefinition
(
$value
))
{
$list
[]
=
$value
;
$list
[]
=
$value
;
...
@@ -931,7 +931,7 @@ abstract class AbstractSchemaManager
...
@@ -931,7 +931,7 @@ abstract class AbstractSchemaManager
*/
*/
protected
function
_getPortableUsersList
(
$users
)
protected
function
_getPortableUsersList
(
$users
)
{
{
$list
=
array
()
;
$list
=
[]
;
foreach
(
$users
as
$value
)
{
foreach
(
$users
as
$value
)
{
if
(
$value
=
$this
->
_getPortableUserDefinition
(
$value
))
{
if
(
$value
=
$this
->
_getPortableUserDefinition
(
$value
))
{
$list
[]
=
$value
;
$list
[]
=
$value
;
...
@@ -958,7 +958,7 @@ abstract class AbstractSchemaManager
...
@@ -958,7 +958,7 @@ abstract class AbstractSchemaManager
*/
*/
protected
function
_getPortableViewsList
(
$views
)
protected
function
_getPortableViewsList
(
$views
)
{
{
$list
=
array
()
;
$list
=
[]
;
foreach
(
$views
as
$value
)
{
foreach
(
$views
as
$value
)
{
if
(
$view
=
$this
->
_getPortableViewDefinition
(
$value
))
{
if
(
$view
=
$this
->
_getPortableViewDefinition
(
$value
))
{
$viewName
=
strtolower
(
$view
->
getQuotedName
(
$this
->
_platform
));
$viewName
=
strtolower
(
$view
->
getQuotedName
(
$this
->
_platform
));
...
@@ -986,7 +986,7 @@ abstract class AbstractSchemaManager
...
@@ -986,7 +986,7 @@ abstract class AbstractSchemaManager
*/
*/
protected
function
_getPortableTableForeignKeysList
(
$tableForeignKeys
)
protected
function
_getPortableTableForeignKeysList
(
$tableForeignKeys
)
{
{
$list
=
array
()
;
$list
=
[]
;
foreach
(
$tableForeignKeys
as
$value
)
{
foreach
(
$tableForeignKeys
as
$value
)
{
if
(
$value
=
$this
->
_getPortableTableForeignKeyDefinition
(
$value
))
{
if
(
$value
=
$this
->
_getPortableTableForeignKeyDefinition
(
$value
))
{
$list
[]
=
$value
;
$list
[]
=
$value
;
...
@@ -1025,13 +1025,13 @@ abstract class AbstractSchemaManager
...
@@ -1025,13 +1025,13 @@ abstract class AbstractSchemaManager
*/
*/
public
function
createSchema
()
public
function
createSchema
()
{
{
$namespaces
=
array
()
;
$namespaces
=
[]
;
if
(
$this
->
_platform
->
supportsSchemas
())
{
if
(
$this
->
_platform
->
supportsSchemas
())
{
$namespaces
=
$this
->
listNamespaceNames
();
$namespaces
=
$this
->
listNamespaceNames
();
}
}
$sequences
=
array
()
;
$sequences
=
[]
;
if
(
$this
->
_platform
->
supportsSequences
())
{
if
(
$this
->
_platform
->
supportsSequences
())
{
$sequences
=
$this
->
listSequences
();
$sequences
=
$this
->
listSequences
();
...
@@ -1079,7 +1079,7 @@ abstract class AbstractSchemaManager
...
@@ -1079,7 +1079,7 @@ abstract class AbstractSchemaManager
*/
*/
public
function
getSchemaSearchPaths
()
public
function
getSchemaSearchPaths
()
{
{
return
array
(
$this
->
_conn
->
getDatabase
())
;
return
[
$this
->
_conn
->
getDatabase
()]
;
}
}
/**
/**
...
...
lib/Doctrine/DBAL/Schema/Column.php
View file @
80f42dc7
...
@@ -78,7 +78,7 @@ class Column extends AbstractAsset
...
@@ -78,7 +78,7 @@ class Column extends AbstractAsset
/**
/**
* @var array
* @var array
*/
*/
protected
$_platformOptions
=
array
()
;
protected
$_platformOptions
=
[]
;
/**
/**
* @var string|null
* @var string|null
...
@@ -93,7 +93,7 @@ class Column extends AbstractAsset
...
@@ -93,7 +93,7 @@ class Column extends AbstractAsset
/**
/**
* @var array
* @var array
*/
*/
protected
$_customSchemaOptions
=
array
()
;
protected
$_customSchemaOptions
=
[]
;
/**
/**
* Creates a new Column.
* Creates a new Column.
...
@@ -102,7 +102,7 @@ class Column extends AbstractAsset
...
@@ -102,7 +102,7 @@ class Column extends AbstractAsset
* @param Type $type
* @param Type $type
* @param array $options
* @param array $options
*/
*/
public
function
__construct
(
$columnName
,
Type
$type
,
array
$options
=
array
()
)
public
function
__construct
(
$columnName
,
Type
$type
,
array
$options
=
[]
)
{
{
$this
->
_setName
(
$columnName
);
$this
->
_setName
(
$columnName
);
$this
->
setType
(
$type
);
$this
->
setType
(
$type
);
...
@@ -469,7 +469,7 @@ class Column extends AbstractAsset
...
@@ -469,7 +469,7 @@ class Column extends AbstractAsset
*/
*/
public
function
toArray
()
public
function
toArray
()
{
{
return
array_merge
(
array
(
return
array_merge
(
[
'name'
=>
$this
->
_name
,
'name'
=>
$this
->
_name
,
'type'
=>
$this
->
_type
,
'type'
=>
$this
->
_type
,
'default'
=>
$this
->
_default
,
'default'
=>
$this
->
_default
,
...
@@ -482,6 +482,6 @@ class Column extends AbstractAsset
...
@@ -482,6 +482,6 @@ class Column extends AbstractAsset
'autoincrement'
=>
$this
->
_autoincrement
,
'autoincrement'
=>
$this
->
_autoincrement
,
'columnDefinition'
=>
$this
->
_columnDefinition
,
'columnDefinition'
=>
$this
->
_columnDefinition
,
'comment'
=>
$this
->
_comment
,
'comment'
=>
$this
->
_comment
,
)
,
$this
->
_platformOptions
,
$this
->
_customSchemaOptions
);
]
,
$this
->
_platformOptions
,
$this
->
_customSchemaOptions
);
}
}
}
}
lib/Doctrine/DBAL/Schema/ColumnDiff.php
View file @
80f42dc7
...
@@ -41,7 +41,7 @@ class ColumnDiff
...
@@ -41,7 +41,7 @@ class ColumnDiff
/**
/**
* @var array
* @var array
*/
*/
public
$changedProperties
=
array
()
;
public
$changedProperties
=
[]
;
/**
/**
* @var Column
* @var Column
...
@@ -54,7 +54,7 @@ class ColumnDiff
...
@@ -54,7 +54,7 @@ class ColumnDiff
* @param string[] $changedProperties
* @param string[] $changedProperties
* @param Column $fromColumn
* @param Column $fromColumn
*/
*/
public
function
__construct
(
$oldColumnName
,
Column
$column
,
array
$changedProperties
=
array
()
,
Column
$fromColumn
=
null
)
public
function
__construct
(
$oldColumnName
,
Column
$column
,
array
$changedProperties
=
[]
,
Column
$fromColumn
=
null
)
{
{
$this
->
oldColumnName
=
$oldColumnName
;
$this
->
oldColumnName
=
$oldColumnName
;
$this
->
column
=
$column
;
$this
->
column
=
$column
;
...
...
lib/Doctrine/DBAL/Schema/Comparator.php
View file @
80f42dc7
...
@@ -60,7 +60,7 @@ class Comparator
...
@@ -60,7 +60,7 @@ class Comparator
$diff
=
new
SchemaDiff
();
$diff
=
new
SchemaDiff
();
$diff
->
fromSchema
=
$fromSchema
;
$diff
->
fromSchema
=
$fromSchema
;
$foreignKeysToTable
=
array
()
;
$foreignKeysToTable
=
[]
;
foreach
(
$toSchema
->
getNamespaces
()
as
$namespace
)
{
foreach
(
$toSchema
->
getNamespaces
()
as
$namespace
)
{
if
(
!
$fromSchema
->
hasNamespace
(
$namespace
))
{
if
(
!
$fromSchema
->
hasNamespace
(
$namespace
))
{
...
@@ -99,7 +99,7 @@ class Comparator
...
@@ -99,7 +99,7 @@ class Comparator
foreach
(
$table
->
getForeignKeys
()
as
$foreignKey
)
{
foreach
(
$table
->
getForeignKeys
()
as
$foreignKey
)
{
$foreignTable
=
strtolower
(
$foreignKey
->
getForeignTableName
());
$foreignTable
=
strtolower
(
$foreignKey
->
getForeignTableName
());
if
(
!
isset
(
$foreignKeysToTable
[
$foreignTable
]))
{
if
(
!
isset
(
$foreignKeysToTable
[
$foreignTable
]))
{
$foreignKeysToTable
[
$foreignTable
]
=
array
()
;
$foreignKeysToTable
[
$foreignTable
]
=
[]
;
}
}
$foreignKeysToTable
[
$foreignTable
][]
=
$foreignKey
;
$foreignKeysToTable
[
$foreignTable
][]
=
$foreignKey
;
}
}
...
@@ -315,11 +315,11 @@ class Comparator
...
@@ -315,11 +315,11 @@ class Comparator
*/
*/
private
function
detectColumnRenamings
(
TableDiff
$tableDifferences
)
private
function
detectColumnRenamings
(
TableDiff
$tableDifferences
)
{
{
$renameCandidates
=
array
()
;
$renameCandidates
=
[]
;
foreach
(
$tableDifferences
->
addedColumns
as
$addedColumnName
=>
$addedColumn
)
{
foreach
(
$tableDifferences
->
addedColumns
as
$addedColumnName
=>
$addedColumn
)
{
foreach
(
$tableDifferences
->
removedColumns
as
$removedColumn
)
{
foreach
(
$tableDifferences
->
removedColumns
as
$removedColumn
)
{
if
(
count
(
$this
->
diffColumn
(
$addedColumn
,
$removedColumn
))
==
0
)
{
if
(
count
(
$this
->
diffColumn
(
$addedColumn
,
$removedColumn
))
==
0
)
{
$renameCandidates
[
$addedColumn
->
getName
()][]
=
array
(
$removedColumn
,
$addedColumn
,
$addedColumnName
)
;
$renameCandidates
[
$addedColumn
->
getName
()][]
=
[
$removedColumn
,
$addedColumn
,
$addedColumnName
]
;
}
}
}
}
}
}
...
@@ -349,13 +349,13 @@ class Comparator
...
@@ -349,13 +349,13 @@ class Comparator
*/
*/
private
function
detectIndexRenamings
(
TableDiff
$tableDifferences
)
private
function
detectIndexRenamings
(
TableDiff
$tableDifferences
)
{
{
$renameCandidates
=
array
()
;
$renameCandidates
=
[]
;
// Gather possible rename candidates by comparing each added and removed index based on semantics.
// Gather possible rename candidates by comparing each added and removed index based on semantics.
foreach
(
$tableDifferences
->
addedIndexes
as
$addedIndexName
=>
$addedIndex
)
{
foreach
(
$tableDifferences
->
addedIndexes
as
$addedIndexName
=>
$addedIndex
)
{
foreach
(
$tableDifferences
->
removedIndexes
as
$removedIndex
)
{
foreach
(
$tableDifferences
->
removedIndexes
as
$removedIndex
)
{
if
(
!
$this
->
diffIndex
(
$addedIndex
,
$removedIndex
))
{
if
(
!
$this
->
diffIndex
(
$addedIndex
,
$removedIndex
))
{
$renameCandidates
[
$addedIndex
->
getName
()][]
=
array
(
$removedIndex
,
$addedIndex
,
$addedIndexName
)
;
$renameCandidates
[
$addedIndex
->
getName
()][]
=
[
$removedIndex
,
$addedIndex
,
$addedIndexName
]
;
}
}
}
}
}
}
...
@@ -427,9 +427,9 @@ class Comparator
...
@@ -427,9 +427,9 @@ class Comparator
$properties1
=
$column1
->
toArray
();
$properties1
=
$column1
->
toArray
();
$properties2
=
$column2
->
toArray
();
$properties2
=
$column2
->
toArray
();
$changedProperties
=
array
()
;
$changedProperties
=
[]
;
foreach
(
array
(
'type'
,
'notnull'
,
'unsigned'
,
'autoincrement'
)
as
$property
)
{
foreach
(
[
'type'
,
'notnull'
,
'unsigned'
,
'autoincrement'
]
as
$property
)
{
if
(
$properties1
[
$property
]
!=
$properties2
[
$property
])
{
if
(
$properties1
[
$property
]
!=
$properties2
[
$property
])
{
$changedProperties
[]
=
$property
;
$changedProperties
[]
=
$property
;
}
}
...
...
lib/Doctrine/DBAL/Schema/DB2SchemaManager.php
View file @
80f42dc7
...
@@ -90,7 +90,7 @@ class DB2SchemaManager extends AbstractSchemaManager
...
@@ -90,7 +90,7 @@ class DB2SchemaManager extends AbstractSchemaManager
break
;
break
;
}
}
$options
=
array
(
$options
=
[
'length'
=>
$length
,
'length'
=>
$length
,
'unsigned'
=>
(
bool
)
$unsigned
,
'unsigned'
=>
(
bool
)
$unsigned
,
'fixed'
=>
(
bool
)
$fixed
,
'fixed'
=>
(
bool
)
$fixed
,
...
@@ -102,8 +102,8 @@ class DB2SchemaManager extends AbstractSchemaManager
...
@@ -102,8 +102,8 @@ class DB2SchemaManager extends AbstractSchemaManager
'comment'
=>
isset
(
$tableColumn
[
'comment'
])
&&
$tableColumn
[
'comment'
]
!==
''
'comment'
=>
isset
(
$tableColumn
[
'comment'
])
&&
$tableColumn
[
'comment'
]
!==
''
?
$tableColumn
[
'comment'
]
?
$tableColumn
[
'comment'
]
:
null
,
:
null
,
'platformOptions'
=>
array
()
,
'platformOptions'
=>
[]
,
)
;
]
;
if
(
$scale
!==
null
&&
$precision
!==
null
)
{
if
(
$scale
!==
null
&&
$precision
!==
null
)
{
$options
[
'scale'
]
=
$scale
;
$options
[
'scale'
]
=
$scale
;
...
@@ -118,7 +118,7 @@ class DB2SchemaManager extends AbstractSchemaManager
...
@@ -118,7 +118,7 @@ class DB2SchemaManager extends AbstractSchemaManager
*/
*/
protected
function
_getPortableTablesList
(
$tables
)
protected
function
_getPortableTablesList
(
$tables
)
{
{
$tableNames
=
array
()
;
$tableNames
=
[]
;
foreach
(
$tables
as
$tableRow
)
{
foreach
(
$tables
as
$tableRow
)
{
$tableRow
=
array_change_key_case
(
$tableRow
,
\CASE_LOWER
);
$tableRow
=
array_change_key_case
(
$tableRow
,
\CASE_LOWER
);
$tableNames
[]
=
$tableRow
[
'name'
];
$tableNames
[]
=
$tableRow
[
'name'
];
...
@@ -159,22 +159,22 @@ class DB2SchemaManager extends AbstractSchemaManager
...
@@ -159,22 +159,22 @@ class DB2SchemaManager extends AbstractSchemaManager
*/
*/
protected
function
_getPortableTableForeignKeysList
(
$tableForeignKeys
)
protected
function
_getPortableTableForeignKeysList
(
$tableForeignKeys
)
{
{
$foreignKeys
=
array
()
;
$foreignKeys
=
[]
;
foreach
(
$tableForeignKeys
as
$tableForeignKey
)
{
foreach
(
$tableForeignKeys
as
$tableForeignKey
)
{
$tableForeignKey
=
array_change_key_case
(
$tableForeignKey
,
\CASE_LOWER
);
$tableForeignKey
=
array_change_key_case
(
$tableForeignKey
,
\CASE_LOWER
);
if
(
!
isset
(
$foreignKeys
[
$tableForeignKey
[
'index_name'
]]))
{
if
(
!
isset
(
$foreignKeys
[
$tableForeignKey
[
'index_name'
]]))
{
$foreignKeys
[
$tableForeignKey
[
'index_name'
]]
=
array
(
$foreignKeys
[
$tableForeignKey
[
'index_name'
]]
=
[
'local_columns'
=>
array
(
$tableForeignKey
[
'local_column'
])
,
'local_columns'
=>
[
$tableForeignKey
[
'local_column'
]]
,
'foreign_table'
=>
$tableForeignKey
[
'foreign_table'
],
'foreign_table'
=>
$tableForeignKey
[
'foreign_table'
],
'foreign_columns'
=>
array
(
$tableForeignKey
[
'foreign_column'
])
,
'foreign_columns'
=>
[
$tableForeignKey
[
'foreign_column'
]]
,
'name'
=>
$tableForeignKey
[
'index_name'
],
'name'
=>
$tableForeignKey
[
'index_name'
],
'options'
=>
array
(
'options'
=>
[
'onUpdate'
=>
$tableForeignKey
[
'on_update'
],
'onUpdate'
=>
$tableForeignKey
[
'on_update'
],
'onDelete'
=>
$tableForeignKey
[
'on_delete'
],
'onDelete'
=>
$tableForeignKey
[
'on_delete'
],
)
]
)
;
]
;
}
else
{
}
else
{
$foreignKeys
[
$tableForeignKey
[
'index_name'
]][
'local_columns'
][]
=
$tableForeignKey
[
'local_column'
];
$foreignKeys
[
$tableForeignKey
[
'index_name'
]][
'local_columns'
][]
=
$tableForeignKey
[
'local_column'
];
$foreignKeys
[
$tableForeignKey
[
'index_name'
]][
'foreign_columns'
][]
=
$tableForeignKey
[
'foreign_column'
];
$foreignKeys
[
$tableForeignKey
[
'index_name'
]][
'foreign_columns'
][]
=
$tableForeignKey
[
'foreign_column'
];
...
...
lib/Doctrine/DBAL/Schema/DrizzleSchemaManager.php
View file @
80f42dc7
...
@@ -39,7 +39,7 @@ class DrizzleSchemaManager extends AbstractSchemaManager
...
@@ -39,7 +39,7 @@ class DrizzleSchemaManager extends AbstractSchemaManager
$type
=
$this
->
extractDoctrineTypeFromComment
(
$tableColumn
[
'COLUMN_COMMENT'
],
$type
);
$type
=
$this
->
extractDoctrineTypeFromComment
(
$tableColumn
[
'COLUMN_COMMENT'
],
$type
);
$tableColumn
[
'COLUMN_COMMENT'
]
=
$this
->
removeDoctrineTypeFromComment
(
$tableColumn
[
'COLUMN_COMMENT'
],
$type
);
$tableColumn
[
'COLUMN_COMMENT'
]
=
$this
->
removeDoctrineTypeFromComment
(
$tableColumn
[
'COLUMN_COMMENT'
],
$type
);
$options
=
array
(
$options
=
[
'notnull'
=>
!
(
bool
)
$tableColumn
[
'IS_NULLABLE'
],
'notnull'
=>
!
(
bool
)
$tableColumn
[
'IS_NULLABLE'
],
'length'
=>
(
int
)
$tableColumn
[
'CHARACTER_MAXIMUM_LENGTH'
],
'length'
=>
(
int
)
$tableColumn
[
'CHARACTER_MAXIMUM_LENGTH'
],
'default'
=>
isset
(
$tableColumn
[
'COLUMN_DEFAULT'
])
?
$tableColumn
[
'COLUMN_DEFAULT'
]
:
null
,
'default'
=>
isset
(
$tableColumn
[
'COLUMN_DEFAULT'
])
?
$tableColumn
[
'COLUMN_DEFAULT'
]
:
null
,
...
@@ -49,7 +49,7 @@ class DrizzleSchemaManager extends AbstractSchemaManager
...
@@ -49,7 +49,7 @@ class DrizzleSchemaManager extends AbstractSchemaManager
'comment'
=>
isset
(
$tableColumn
[
'COLUMN_COMMENT'
])
&&
''
!==
$tableColumn
[
'COLUMN_COMMENT'
]
'comment'
=>
isset
(
$tableColumn
[
'COLUMN_COMMENT'
])
&&
''
!==
$tableColumn
[
'COLUMN_COMMENT'
]
?
$tableColumn
[
'COLUMN_COMMENT'
]
?
$tableColumn
[
'COLUMN_COMMENT'
]
:
null
,
:
null
,
)
;
]
;
$column
=
new
Column
(
$tableColumn
[
'COLUMN_NAME'
],
Type
::
getType
(
$type
),
$options
);
$column
=
new
Column
(
$tableColumn
[
'COLUMN_NAME'
],
Type
::
getType
(
$type
),
$options
);
...
@@ -81,12 +81,12 @@ class DrizzleSchemaManager extends AbstractSchemaManager
...
@@ -81,12 +81,12 @@ class DrizzleSchemaManager extends AbstractSchemaManager
*/
*/
public
function
_getPortableTableForeignKeyDefinition
(
$tableForeignKey
)
public
function
_getPortableTableForeignKeyDefinition
(
$tableForeignKey
)
{
{
$columns
=
array
()
;
$columns
=
[]
;
foreach
(
explode
(
','
,
$tableForeignKey
[
'CONSTRAINT_COLUMNS'
])
as
$value
)
{
foreach
(
explode
(
','
,
$tableForeignKey
[
'CONSTRAINT_COLUMNS'
])
as
$value
)
{
$columns
[]
=
trim
(
$value
,
' `'
);
$columns
[]
=
trim
(
$value
,
' `'
);
}
}
$refColumns
=
array
()
;
$refColumns
=
[]
;
foreach
(
explode
(
','
,
$tableForeignKey
[
'REFERENCED_TABLE_COLUMNS'
])
as
$value
)
{
foreach
(
explode
(
','
,
$tableForeignKey
[
'REFERENCED_TABLE_COLUMNS'
])
as
$value
)
{
$refColumns
[]
=
trim
(
$value
,
' `'
);
$refColumns
[]
=
trim
(
$value
,
' `'
);
}
}
...
@@ -96,10 +96,10 @@ class DrizzleSchemaManager extends AbstractSchemaManager
...
@@ -96,10 +96,10 @@ class DrizzleSchemaManager extends AbstractSchemaManager
$tableForeignKey
[
'REFERENCED_TABLE_NAME'
],
$tableForeignKey
[
'REFERENCED_TABLE_NAME'
],
$refColumns
,
$refColumns
,
$tableForeignKey
[
'CONSTRAINT_NAME'
],
$tableForeignKey
[
'CONSTRAINT_NAME'
],
array
(
[
'onUpdate'
=>
$tableForeignKey
[
'UPDATE_RULE'
],
'onUpdate'
=>
$tableForeignKey
[
'UPDATE_RULE'
],
'onDelete'
=>
$tableForeignKey
[
'DELETE_RULE'
],
'onDelete'
=>
$tableForeignKey
[
'DELETE_RULE'
],
)
]
);
);
}
}
...
@@ -108,7 +108,7 @@ class DrizzleSchemaManager extends AbstractSchemaManager
...
@@ -108,7 +108,7 @@ class DrizzleSchemaManager extends AbstractSchemaManager
*/
*/
protected
function
_getPortableTableIndexesList
(
$tableIndexes
,
$tableName
=
null
)
protected
function
_getPortableTableIndexesList
(
$tableIndexes
,
$tableName
=
null
)
{
{
$indexes
=
array
()
;
$indexes
=
[]
;
foreach
(
$tableIndexes
as
$k
)
{
foreach
(
$tableIndexes
as
$k
)
{
$k
[
'primary'
]
=
(
boolean
)
$k
[
'primary'
];
$k
[
'primary'
]
=
(
boolean
)
$k
[
'primary'
];
$indexes
[]
=
$k
;
$indexes
[]
=
$k
;
...
...
lib/Doctrine/DBAL/Schema/ForeignKeyConstraint.php
View file @
80f42dc7
...
@@ -75,7 +75,7 @@ class ForeignKeyConstraint extends AbstractAsset implements Constraint
...
@@ -75,7 +75,7 @@ class ForeignKeyConstraint extends AbstractAsset implements Constraint
* @param string|null $name Name of the foreign key constraint.
* @param string|null $name Name of the foreign key constraint.
* @param array $options Options associated with the foreign key constraint.
* @param array $options Options associated with the foreign key constraint.
*/
*/
public
function
__construct
(
array
$localColumnNames
,
$foreignTableName
,
array
$foreignColumnNames
,
$name
=
null
,
array
$options
=
array
()
)
public
function
__construct
(
array
$localColumnNames
,
$foreignTableName
,
array
$foreignColumnNames
,
$name
=
null
,
array
$options
=
[]
)
{
{
$this
->
_setName
(
$name
);
$this
->
_setName
(
$name
);
$identifierConstructorCallback
=
function
(
$column
)
{
$identifierConstructorCallback
=
function
(
$column
)
{
...
@@ -83,7 +83,7 @@ class ForeignKeyConstraint extends AbstractAsset implements Constraint
...
@@ -83,7 +83,7 @@ class ForeignKeyConstraint extends AbstractAsset implements Constraint
};
};
$this
->
_localColumnNames
=
$localColumnNames
$this
->
_localColumnNames
=
$localColumnNames
?
array_combine
(
$localColumnNames
,
array_map
(
$identifierConstructorCallback
,
$localColumnNames
))
?
array_combine
(
$localColumnNames
,
array_map
(
$identifierConstructorCallback
,
$localColumnNames
))
:
array
()
;
:
[]
;
if
(
$foreignTableName
instanceof
Table
)
{
if
(
$foreignTableName
instanceof
Table
)
{
$this
->
_foreignTableName
=
$foreignTableName
;
$this
->
_foreignTableName
=
$foreignTableName
;
...
@@ -93,7 +93,7 @@ class ForeignKeyConstraint extends AbstractAsset implements Constraint
...
@@ -93,7 +93,7 @@ class ForeignKeyConstraint extends AbstractAsset implements Constraint
$this
->
_foreignColumnNames
=
$foreignColumnNames
$this
->
_foreignColumnNames
=
$foreignColumnNames
?
array_combine
(
$foreignColumnNames
,
array_map
(
$identifierConstructorCallback
,
$foreignColumnNames
))
?
array_combine
(
$foreignColumnNames
,
array_map
(
$identifierConstructorCallback
,
$foreignColumnNames
))
:
array
()
;
:
[]
;
$this
->
_options
=
$options
;
$this
->
_options
=
$options
;
}
}
...
@@ -154,7 +154,7 @@ class ForeignKeyConstraint extends AbstractAsset implements Constraint
...
@@ -154,7 +154,7 @@ class ForeignKeyConstraint extends AbstractAsset implements Constraint
*/
*/
public
function
getQuotedLocalColumns
(
AbstractPlatform
$platform
)
public
function
getQuotedLocalColumns
(
AbstractPlatform
$platform
)
{
{
$columns
=
array
()
;
$columns
=
[]
;
foreach
(
$this
->
_localColumnNames
as
$column
)
{
foreach
(
$this
->
_localColumnNames
as
$column
)
{
$columns
[]
=
$column
->
getQuotedName
(
$platform
);
$columns
[]
=
$column
->
getQuotedName
(
$platform
);
...
@@ -170,7 +170,7 @@ class ForeignKeyConstraint extends AbstractAsset implements Constraint
...
@@ -170,7 +170,7 @@ class ForeignKeyConstraint extends AbstractAsset implements Constraint
*/
*/
public
function
getUnquotedLocalColumns
()
public
function
getUnquotedLocalColumns
()
{
{
return
array_map
(
array
(
$this
,
'trimQuotes'
)
,
$this
->
getLocalColumns
());
return
array_map
(
[
$this
,
'trimQuotes'
]
,
$this
->
getLocalColumns
());
}
}
/**
/**
...
@@ -180,7 +180,7 @@ class ForeignKeyConstraint extends AbstractAsset implements Constraint
...
@@ -180,7 +180,7 @@ class ForeignKeyConstraint extends AbstractAsset implements Constraint
*/
*/
public
function
getUnquotedForeignColumns
()
public
function
getUnquotedForeignColumns
()
{
{
return
array_map
(
array
(
$this
,
'trimQuotes'
)
,
$this
->
getForeignColumns
());
return
array_map
(
[
$this
,
'trimQuotes'
]
,
$this
->
getForeignColumns
());
}
}
/**
/**
...
@@ -277,7 +277,7 @@ class ForeignKeyConstraint extends AbstractAsset implements Constraint
...
@@ -277,7 +277,7 @@ class ForeignKeyConstraint extends AbstractAsset implements Constraint
*/
*/
public
function
getQuotedForeignColumns
(
AbstractPlatform
$platform
)
public
function
getQuotedForeignColumns
(
AbstractPlatform
$platform
)
{
{
$columns
=
array
()
;
$columns
=
[]
;
foreach
(
$this
->
_foreignColumnNames
as
$column
)
{
foreach
(
$this
->
_foreignColumnNames
as
$column
)
{
$columns
[]
=
$column
->
getQuotedName
(
$platform
);
$columns
[]
=
$column
->
getQuotedName
(
$platform
);
...
@@ -356,7 +356,7 @@ class ForeignKeyConstraint extends AbstractAsset implements Constraint
...
@@ -356,7 +356,7 @@ class ForeignKeyConstraint extends AbstractAsset implements Constraint
if
(
isset
(
$this
->
_options
[
$event
]))
{
if
(
isset
(
$this
->
_options
[
$event
]))
{
$onEvent
=
strtoupper
(
$this
->
_options
[
$event
]);
$onEvent
=
strtoupper
(
$this
->
_options
[
$event
]);
if
(
!
in_array
(
$onEvent
,
array
(
'NO ACTION'
,
'RESTRICT'
)
))
{
if
(
!
in_array
(
$onEvent
,
[
'NO ACTION'
,
'RESTRICT'
]
))
{
return
$onEvent
;
return
$onEvent
;
}
}
}
}
...
...
lib/Doctrine/DBAL/Schema/Index.php
View file @
80f42dc7
...
@@ -29,7 +29,7 @@ class Index extends AbstractAsset implements Constraint
...
@@ -29,7 +29,7 @@ class Index extends AbstractAsset implements Constraint
*
*
* @var Identifier[]
* @var Identifier[]
*/
*/
protected
$_columns
=
array
()
;
protected
$_columns
=
[]
;
/**
/**
* @var boolean
* @var boolean
...
@@ -47,7 +47,7 @@ class Index extends AbstractAsset implements Constraint
...
@@ -47,7 +47,7 @@ class Index extends AbstractAsset implements Constraint
*
*
* @var array
* @var array
*/
*/
protected
$_flags
=
array
()
;
protected
$_flags
=
[]
;
/**
/**
* Platform specific options
* Platform specific options
...
@@ -56,7 +56,7 @@ class Index extends AbstractAsset implements Constraint
...
@@ -56,7 +56,7 @@ class Index extends AbstractAsset implements Constraint
*
*
* @var array
* @var array
*/
*/
private
$options
=
array
()
;
private
$options
=
[]
;
/**
/**
* @param string $indexName
* @param string $indexName
...
@@ -66,7 +66,7 @@ class Index extends AbstractAsset implements Constraint
...
@@ -66,7 +66,7 @@ class Index extends AbstractAsset implements Constraint
* @param string[] $flags
* @param string[] $flags
* @param array $options
* @param array $options
*/
*/
public
function
__construct
(
$indexName
,
array
$columns
,
$isUnique
=
false
,
$isPrimary
=
false
,
array
$flags
=
array
(),
array
$options
=
array
()
)
public
function
__construct
(
$indexName
,
array
$columns
,
$isUnique
=
false
,
$isPrimary
=
false
,
array
$flags
=
[],
array
$options
=
[]
)
{
{
$isUnique
=
$isUnique
||
$isPrimary
;
$isUnique
=
$isUnique
||
$isPrimary
;
...
@@ -112,7 +112,7 @@ class Index extends AbstractAsset implements Constraint
...
@@ -112,7 +112,7 @@ class Index extends AbstractAsset implements Constraint
*/
*/
public
function
getQuotedColumns
(
AbstractPlatform
$platform
)
public
function
getQuotedColumns
(
AbstractPlatform
$platform
)
{
{
$columns
=
array
()
;
$columns
=
[]
;
foreach
(
$this
->
_columns
as
$column
)
{
foreach
(
$this
->
_columns
as
$column
)
{
$columns
[]
=
$column
->
getQuotedName
(
$platform
);
$columns
[]
=
$column
->
getQuotedName
(
$platform
);
...
@@ -126,7 +126,7 @@ class Index extends AbstractAsset implements Constraint
...
@@ -126,7 +126,7 @@ class Index extends AbstractAsset implements Constraint
*/
*/
public
function
getUnquotedColumns
()
public
function
getUnquotedColumns
()
{
{
return
array_map
(
array
(
$this
,
'trimQuotes'
)
,
$this
->
getColumns
());
return
array_map
(
[
$this
,
'trimQuotes'
]
,
$this
->
getColumns
());
}
}
/**
/**
...
...
lib/Doctrine/DBAL/Schema/MySqlSchemaManager.php
View file @
80f42dc7
...
@@ -54,10 +54,10 @@ class MySqlSchemaManager extends AbstractSchemaManager
...
@@ -54,10 +54,10 @@ class MySqlSchemaManager extends AbstractSchemaManager
*/
*/
protected
function
_getPortableUserDefinition
(
$user
)
protected
function
_getPortableUserDefinition
(
$user
)
{
{
return
array
(
return
[
'user'
=>
$user
[
'User'
],
'user'
=>
$user
[
'User'
],
'password'
=>
$user
[
'Password'
],
'password'
=>
$user
[
'Password'
],
)
;
]
;
}
}
/**
/**
...
@@ -73,9 +73,9 @@ class MySqlSchemaManager extends AbstractSchemaManager
...
@@ -73,9 +73,9 @@ class MySqlSchemaManager extends AbstractSchemaManager
$v
[
'primary'
]
=
false
;
$v
[
'primary'
]
=
false
;
}
}
if
(
strpos
(
$v
[
'index_type'
],
'FULLTEXT'
)
!==
false
)
{
if
(
strpos
(
$v
[
'index_type'
],
'FULLTEXT'
)
!==
false
)
{
$v
[
'flags'
]
=
array
(
'FULLTEXT'
)
;
$v
[
'flags'
]
=
[
'FULLTEXT'
]
;
}
elseif
(
strpos
(
$v
[
'index_type'
],
'SPATIAL'
)
!==
false
)
{
}
elseif
(
strpos
(
$v
[
'index_type'
],
'SPATIAL'
)
!==
false
)
{
$v
[
'flags'
]
=
array
(
'SPATIAL'
)
;
$v
[
'flags'
]
=
[
'SPATIAL'
]
;
}
}
$tableIndexes
[
$k
]
=
$v
;
$tableIndexes
[
$k
]
=
$v
;
}
}
...
@@ -178,7 +178,7 @@ class MySqlSchemaManager extends AbstractSchemaManager
...
@@ -178,7 +178,7 @@ class MySqlSchemaManager extends AbstractSchemaManager
$length
=
((
int
)
$length
==
0
)
?
null
:
(
int
)
$length
;
$length
=
((
int
)
$length
==
0
)
?
null
:
(
int
)
$length
;
$options
=
array
(
$options
=
[
'length'
=>
$length
,
'length'
=>
$length
,
'unsigned'
=>
(
bool
)
(
strpos
(
$tableColumn
[
'type'
],
'unsigned'
)
!==
false
),
'unsigned'
=>
(
bool
)
(
strpos
(
$tableColumn
[
'type'
],
'unsigned'
)
!==
false
),
'fixed'
=>
(
bool
)
$fixed
,
'fixed'
=>
(
bool
)
$fixed
,
...
@@ -190,7 +190,7 @@ class MySqlSchemaManager extends AbstractSchemaManager
...
@@ -190,7 +190,7 @@ class MySqlSchemaManager extends AbstractSchemaManager
'comment'
=>
isset
(
$tableColumn
[
'comment'
])
&&
$tableColumn
[
'comment'
]
!==
''
'comment'
=>
isset
(
$tableColumn
[
'comment'
])
&&
$tableColumn
[
'comment'
]
!==
''
?
$tableColumn
[
'comment'
]
?
$tableColumn
[
'comment'
]
:
null
,
:
null
,
)
;
]
;
if
(
$scale
!==
null
&&
$precision
!==
null
)
{
if
(
$scale
!==
null
&&
$precision
!==
null
)
{
$options
[
'scale'
]
=
$scale
;
$options
[
'scale'
]
=
$scale
;
...
@@ -211,7 +211,7 @@ class MySqlSchemaManager extends AbstractSchemaManager
...
@@ -211,7 +211,7 @@ class MySqlSchemaManager extends AbstractSchemaManager
*/
*/
protected
function
_getPortableTableForeignKeysList
(
$tableForeignKeys
)
protected
function
_getPortableTableForeignKeysList
(
$tableForeignKeys
)
{
{
$list
=
array
()
;
$list
=
[]
;
foreach
(
$tableForeignKeys
as
$value
)
{
foreach
(
$tableForeignKeys
as
$value
)
{
$value
=
array_change_key_case
(
$value
,
CASE_LOWER
);
$value
=
array_change_key_case
(
$value
,
CASE_LOWER
);
if
(
!
isset
(
$list
[
$value
[
'constraint_name'
]]))
{
if
(
!
isset
(
$list
[
$value
[
'constraint_name'
]]))
{
...
@@ -222,28 +222,28 @@ class MySqlSchemaManager extends AbstractSchemaManager
...
@@ -222,28 +222,28 @@ class MySqlSchemaManager extends AbstractSchemaManager
$value
[
'update_rule'
]
=
null
;
$value
[
'update_rule'
]
=
null
;
}
}
$list
[
$value
[
'constraint_name'
]]
=
array
(
$list
[
$value
[
'constraint_name'
]]
=
[
'name'
=>
$value
[
'constraint_name'
],
'name'
=>
$value
[
'constraint_name'
],
'local'
=>
array
()
,
'local'
=>
[]
,
'foreign'
=>
array
()
,
'foreign'
=>
[]
,
'foreignTable'
=>
$value
[
'referenced_table_name'
],
'foreignTable'
=>
$value
[
'referenced_table_name'
],
'onDelete'
=>
$value
[
'delete_rule'
],
'onDelete'
=>
$value
[
'delete_rule'
],
'onUpdate'
=>
$value
[
'update_rule'
],
'onUpdate'
=>
$value
[
'update_rule'
],
)
;
]
;
}
}
$list
[
$value
[
'constraint_name'
]][
'local'
][]
=
$value
[
'column_name'
];
$list
[
$value
[
'constraint_name'
]][
'local'
][]
=
$value
[
'column_name'
];
$list
[
$value
[
'constraint_name'
]][
'foreign'
][]
=
$value
[
'referenced_column_name'
];
$list
[
$value
[
'constraint_name'
]][
'foreign'
][]
=
$value
[
'referenced_column_name'
];
}
}
$result
=
array
()
;
$result
=
[]
;
foreach
(
$list
as
$constraint
)
{
foreach
(
$list
as
$constraint
)
{
$result
[]
=
new
ForeignKeyConstraint
(
$result
[]
=
new
ForeignKeyConstraint
(
array_values
(
$constraint
[
'local'
]),
$constraint
[
'foreignTable'
],
array_values
(
$constraint
[
'local'
]),
$constraint
[
'foreignTable'
],
array_values
(
$constraint
[
'foreign'
]),
$constraint
[
'name'
],
array_values
(
$constraint
[
'foreign'
]),
$constraint
[
'name'
],
array
(
[
'onDelete'
=>
$constraint
[
'onDelete'
],
'onDelete'
=>
$constraint
[
'onDelete'
],
'onUpdate'
=>
$constraint
[
'onUpdate'
],
'onUpdate'
=>
$constraint
[
'onUpdate'
],
)
]
);
);
}
}
...
...
lib/Doctrine/DBAL/Schema/OracleSchemaManager.php
View file @
80f42dc7
...
@@ -78,9 +78,9 @@ class OracleSchemaManager extends AbstractSchemaManager
...
@@ -78,9 +78,9 @@ class OracleSchemaManager extends AbstractSchemaManager
{
{
$user
=
\array_change_key_case
(
$user
,
CASE_LOWER
);
$user
=
\array_change_key_case
(
$user
,
CASE_LOWER
);
return
array
(
return
[
'user'
=>
$user
[
'username'
],
'user'
=>
$user
[
'username'
],
)
;
]
;
}
}
/**
/**
...
@@ -101,7 +101,7 @@ class OracleSchemaManager extends AbstractSchemaManager
...
@@ -101,7 +101,7 @@ class OracleSchemaManager extends AbstractSchemaManager
*/
*/
protected
function
_getPortableTableIndexesList
(
$tableIndexes
,
$tableName
=
null
)
protected
function
_getPortableTableIndexesList
(
$tableIndexes
,
$tableName
=
null
)
{
{
$indexBuffer
=
array
()
;
$indexBuffer
=
[]
;
foreach
(
$tableIndexes
as
$tableIndex
)
{
foreach
(
$tableIndexes
as
$tableIndex
)
{
$tableIndex
=
\array_change_key_case
(
$tableIndex
,
CASE_LOWER
);
$tableIndex
=
\array_change_key_case
(
$tableIndex
,
CASE_LOWER
);
...
@@ -227,7 +227,7 @@ class OracleSchemaManager extends AbstractSchemaManager
...
@@ -227,7 +227,7 @@ class OracleSchemaManager extends AbstractSchemaManager
$length
=
null
;
$length
=
null
;
}
}
$options
=
array
(
$options
=
[
'notnull'
=>
(
bool
)
(
$tableColumn
[
'nullable'
]
===
'N'
),
'notnull'
=>
(
bool
)
(
$tableColumn
[
'nullable'
]
===
'N'
),
'fixed'
=>
(
bool
)
$fixed
,
'fixed'
=>
(
bool
)
$fixed
,
'unsigned'
=>
(
bool
)
$unsigned
,
'unsigned'
=>
(
bool
)
$unsigned
,
...
@@ -238,8 +238,8 @@ class OracleSchemaManager extends AbstractSchemaManager
...
@@ -238,8 +238,8 @@ class OracleSchemaManager extends AbstractSchemaManager
'comment'
=>
isset
(
$tableColumn
[
'comments'
])
&&
''
!==
$tableColumn
[
'comments'
]
'comment'
=>
isset
(
$tableColumn
[
'comments'
])
&&
''
!==
$tableColumn
[
'comments'
]
?
$tableColumn
[
'comments'
]
?
$tableColumn
[
'comments'
]
:
null
,
:
null
,
'platformDetails'
=>
array
()
,
'platformDetails'
=>
[]
,
)
;
]
;
return
new
Column
(
$this
->
getQuotedIdentifierName
(
$tableColumn
[
'column_name'
]),
Type
::
getType
(
$type
),
$options
);
return
new
Column
(
$this
->
getQuotedIdentifierName
(
$tableColumn
[
'column_name'
]),
Type
::
getType
(
$type
),
$options
);
}
}
...
@@ -249,7 +249,7 @@ class OracleSchemaManager extends AbstractSchemaManager
...
@@ -249,7 +249,7 @@ class OracleSchemaManager extends AbstractSchemaManager
*/
*/
protected
function
_getPortableTableForeignKeysList
(
$tableForeignKeys
)
protected
function
_getPortableTableForeignKeysList
(
$tableForeignKeys
)
{
{
$list
=
array
()
;
$list
=
[]
;
foreach
(
$tableForeignKeys
as
$value
)
{
foreach
(
$tableForeignKeys
as
$value
)
{
$value
=
\array_change_key_case
(
$value
,
CASE_LOWER
);
$value
=
\array_change_key_case
(
$value
,
CASE_LOWER
);
if
(
!
isset
(
$list
[
$value
[
'constraint_name'
]]))
{
if
(
!
isset
(
$list
[
$value
[
'constraint_name'
]]))
{
...
@@ -257,13 +257,13 @@ class OracleSchemaManager extends AbstractSchemaManager
...
@@ -257,13 +257,13 @@ class OracleSchemaManager extends AbstractSchemaManager
$value
[
'delete_rule'
]
=
null
;
$value
[
'delete_rule'
]
=
null
;
}
}
$list
[
$value
[
'constraint_name'
]]
=
array
(
$list
[
$value
[
'constraint_name'
]]
=
[
'name'
=>
$this
->
getQuotedIdentifierName
(
$value
[
'constraint_name'
]),
'name'
=>
$this
->
getQuotedIdentifierName
(
$value
[
'constraint_name'
]),
'local'
=>
array
()
,
'local'
=>
[]
,
'foreign'
=>
array
()
,
'foreign'
=>
[]
,
'foreignTable'
=>
$value
[
'references_table'
],
'foreignTable'
=>
$value
[
'references_table'
],
'onDelete'
=>
$value
[
'delete_rule'
],
'onDelete'
=>
$value
[
'delete_rule'
],
)
;
]
;
}
}
$localColumn
=
$this
->
getQuotedIdentifierName
(
$value
[
'local_column'
]);
$localColumn
=
$this
->
getQuotedIdentifierName
(
$value
[
'local_column'
]);
...
@@ -273,12 +273,12 @@ class OracleSchemaManager extends AbstractSchemaManager
...
@@ -273,12 +273,12 @@ class OracleSchemaManager extends AbstractSchemaManager
$list
[
$value
[
'constraint_name'
]][
'foreign'
][
$value
[
'position'
]]
=
$foreignColumn
;
$list
[
$value
[
'constraint_name'
]][
'foreign'
][
$value
[
'position'
]]
=
$foreignColumn
;
}
}
$result
=
array
()
;
$result
=
[]
;
foreach
(
$list
as
$constraint
)
{
foreach
(
$list
as
$constraint
)
{
$result
[]
=
new
ForeignKeyConstraint
(
$result
[]
=
new
ForeignKeyConstraint
(
array_values
(
$constraint
[
'local'
]),
$this
->
getQuotedIdentifierName
(
$constraint
[
'foreignTable'
]),
array_values
(
$constraint
[
'local'
]),
$this
->
getQuotedIdentifierName
(
$constraint
[
'foreignTable'
]),
array_values
(
$constraint
[
'foreign'
]),
$this
->
getQuotedIdentifierName
(
$constraint
[
'name'
]),
array_values
(
$constraint
[
'foreign'
]),
$this
->
getQuotedIdentifierName
(
$constraint
[
'name'
]),
array
(
'onDelete'
=>
$constraint
[
'onDelete'
])
[
'onDelete'
=>
$constraint
[
'onDelete'
]]
);
);
}
}
...
@@ -408,7 +408,7 @@ WHERE
...
@@ -408,7 +408,7 @@ WHERE
AND p.addr(+) = s.paddr
AND p.addr(+) = s.paddr
SQL;
SQL;
$activeUserSessions
=
$this
->
_conn
->
fetchAll
(
$sql
,
array
(
strtoupper
(
$user
))
);
$activeUserSessions
=
$this
->
_conn
->
fetchAll
(
$sql
,
[
strtoupper
(
$user
)]
);
foreach
(
$activeUserSessions
as
$activeUserSession
)
{
foreach
(
$activeUserSessions
as
$activeUserSession
)
{
$activeUserSession
=
array_change_key_case
(
$activeUserSession
,
\CASE_LOWER
);
$activeUserSession
=
array_change_key_case
(
$activeUserSession
,
\CASE_LOWER
);
...
...
lib/Doctrine/DBAL/Schema/PostgreSqlSchemaManager.php
View file @
80f42dc7
...
@@ -118,10 +118,10 @@ class PostgreSqlSchemaManager extends AbstractSchemaManager
...
@@ -118,10 +118,10 @@ class PostgreSqlSchemaManager extends AbstractSchemaManager
}
}
$this
->
_execSql
(
$this
->
_execSql
(
array
(
[
$this
->
_platform
->
getDisallowDatabaseConnectionsSQL
(
$database
),
$this
->
_platform
->
getDisallowDatabaseConnectionsSQL
(
$database
),
$this
->
_platform
->
getCloseActiveDatabaseConnectionsSQL
(
$database
),
$this
->
_platform
->
getCloseActiveDatabaseConnectionsSQL
(
$database
),
)
]
);
);
parent
::
dropDatabase
(
$database
);
parent
::
dropDatabase
(
$database
);
...
@@ -153,7 +153,7 @@ class PostgreSqlSchemaManager extends AbstractSchemaManager
...
@@ -153,7 +153,7 @@ class PostgreSqlSchemaManager extends AbstractSchemaManager
return
new
ForeignKeyConstraint
(
return
new
ForeignKeyConstraint
(
$localColumns
,
$foreignTable
,
$foreignColumns
,
$tableForeignKey
[
'conname'
],
$localColumns
,
$foreignTable
,
$foreignColumns
,
$tableForeignKey
[
'conname'
],
array
(
'onUpdate'
=>
$onUpdate
,
'onDelete'
=>
$onDelete
)
[
'onUpdate'
=>
$onUpdate
,
'onDelete'
=>
$onDelete
]
);
);
}
}
...
@@ -178,10 +178,10 @@ class PostgreSqlSchemaManager extends AbstractSchemaManager
...
@@ -178,10 +178,10 @@ class PostgreSqlSchemaManager extends AbstractSchemaManager
*/
*/
protected
function
_getPortableUserDefinition
(
$user
)
protected
function
_getPortableUserDefinition
(
$user
)
{
{
return
array
(
return
[
'user'
=>
$user
[
'usename'
],
'user'
=>
$user
[
'usename'
],
'password'
=>
$user
[
'passwd'
]
'password'
=>
$user
[
'passwd'
]
)
;
]
;
}
}
/**
/**
...
@@ -207,7 +207,7 @@ class PostgreSqlSchemaManager extends AbstractSchemaManager
...
@@ -207,7 +207,7 @@ class PostgreSqlSchemaManager extends AbstractSchemaManager
*/
*/
protected
function
_getPortableTableIndexesList
(
$tableIndexes
,
$tableName
=
null
)
protected
function
_getPortableTableIndexesList
(
$tableIndexes
,
$tableName
=
null
)
{
{
$buffer
=
array
()
;
$buffer
=
[]
;
foreach
(
$tableIndexes
as
$row
)
{
foreach
(
$tableIndexes
as
$row
)
{
$colNumbers
=
explode
(
' '
,
$row
[
'indkey'
]);
$colNumbers
=
explode
(
' '
,
$row
[
'indkey'
]);
$colNumbersSql
=
'IN ('
.
join
(
' ,'
,
$colNumbers
)
.
' )'
;
$colNumbersSql
=
'IN ('
.
join
(
' ,'
,
$colNumbers
)
.
' )'
;
...
@@ -221,13 +221,13 @@ class PostgreSqlSchemaManager extends AbstractSchemaManager
...
@@ -221,13 +221,13 @@ class PostgreSqlSchemaManager extends AbstractSchemaManager
foreach
(
$colNumbers
as
$colNum
)
{
foreach
(
$colNumbers
as
$colNum
)
{
foreach
(
$indexColumns
as
$colRow
)
{
foreach
(
$indexColumns
as
$colRow
)
{
if
(
$colNum
==
$colRow
[
'attnum'
])
{
if
(
$colNum
==
$colRow
[
'attnum'
])
{
$buffer
[]
=
array
(
$buffer
[]
=
[
'key_name'
=>
$row
[
'relname'
],
'key_name'
=>
$row
[
'relname'
],
'column_name'
=>
trim
(
$colRow
[
'attname'
]),
'column_name'
=>
trim
(
$colRow
[
'attname'
]),
'non_unique'
=>
!
$row
[
'indisunique'
],
'non_unique'
=>
!
$row
[
'indisunique'
],
'primary'
=>
$row
[
'indisprimary'
],
'primary'
=>
$row
[
'indisprimary'
],
'where'
=>
$row
[
'where'
],
'where'
=>
$row
[
'where'
],
)
;
]
;
}
}
}
}
}
}
...
@@ -249,7 +249,7 @@ class PostgreSqlSchemaManager extends AbstractSchemaManager
...
@@ -249,7 +249,7 @@ class PostgreSqlSchemaManager extends AbstractSchemaManager
*/
*/
protected
function
_getPortableSequencesList
(
$sequences
)
protected
function
_getPortableSequencesList
(
$sequences
)
{
{
$sequenceDefinitions
=
array
()
;
$sequenceDefinitions
=
[]
;
foreach
(
$sequences
as
$sequence
)
{
foreach
(
$sequences
as
$sequence
)
{
if
(
$sequence
[
'schemaname'
]
!=
'public'
)
{
if
(
$sequence
[
'schemaname'
]
!=
'public'
)
{
...
@@ -261,7 +261,7 @@ class PostgreSqlSchemaManager extends AbstractSchemaManager
...
@@ -261,7 +261,7 @@ class PostgreSqlSchemaManager extends AbstractSchemaManager
$sequenceDefinitions
[
$sequenceName
]
=
$sequence
;
$sequenceDefinitions
[
$sequenceName
]
=
$sequence
;
}
}
$list
=
array
()
;
$list
=
[]
;
foreach
(
$this
->
filterAssetNames
(
array_keys
(
$sequenceDefinitions
))
as
$sequenceName
)
{
foreach
(
$this
->
filterAssetNames
(
array_keys
(
$sequenceDefinitions
))
as
$sequenceName
)
{
$list
[]
=
$this
->
_getPortableSequenceDefinition
(
$sequenceDefinitions
[
$sequenceName
]);
$list
[]
=
$this
->
_getPortableSequenceDefinition
(
$sequenceDefinitions
[
$sequenceName
]);
...
@@ -307,7 +307,7 @@ class PostgreSqlSchemaManager extends AbstractSchemaManager
...
@@ -307,7 +307,7 @@ class PostgreSqlSchemaManager extends AbstractSchemaManager
$tableColumn
[
'length'
]
=
$length
;
$tableColumn
[
'length'
]
=
$length
;
}
}
$matches
=
array
()
;
$matches
=
[]
;
$autoincrement
=
false
;
$autoincrement
=
false
;
if
(
preg_match
(
"/^nextval\('(.*)'(::.*)?\)$/"
,
$tableColumn
[
'default'
],
$matches
))
{
if
(
preg_match
(
"/^nextval\('(.*)'(::.*)?\)$/"
,
$tableColumn
[
'default'
],
$matches
))
{
...
@@ -423,7 +423,7 @@ class PostgreSqlSchemaManager extends AbstractSchemaManager
...
@@ -423,7 +423,7 @@ class PostgreSqlSchemaManager extends AbstractSchemaManager
$tableColumn
[
'default'
]
=
$match
[
1
];
$tableColumn
[
'default'
]
=
$match
[
1
];
}
}
$options
=
array
(
$options
=
[
'length'
=>
$length
,
'length'
=>
$length
,
'notnull'
=>
(
bool
)
$tableColumn
[
'isnotnull'
],
'notnull'
=>
(
bool
)
$tableColumn
[
'isnotnull'
],
'default'
=>
$tableColumn
[
'default'
],
'default'
=>
$tableColumn
[
'default'
],
...
@@ -436,7 +436,7 @@ class PostgreSqlSchemaManager extends AbstractSchemaManager
...
@@ -436,7 +436,7 @@ class PostgreSqlSchemaManager extends AbstractSchemaManager
'comment'
=>
isset
(
$tableColumn
[
'comment'
])
&&
$tableColumn
[
'comment'
]
!==
''
'comment'
=>
isset
(
$tableColumn
[
'comment'
])
&&
$tableColumn
[
'comment'
]
!==
''
?
$tableColumn
[
'comment'
]
?
$tableColumn
[
'comment'
]
:
null
,
:
null
,
)
;
]
;
$column
=
new
Column
(
$tableColumn
[
'field'
],
Type
::
getType
(
$type
),
$options
);
$column
=
new
Column
(
$tableColumn
[
'field'
],
Type
::
getType
(
$type
),
$options
);
...
...
lib/Doctrine/DBAL/Schema/SQLAnywhereSchemaManager.php
View file @
80f42dc7
...
@@ -111,7 +111,7 @@ class SQLAnywhereSchemaManager extends AbstractSchemaManager
...
@@ -111,7 +111,7 @@ class SQLAnywhereSchemaManager extends AbstractSchemaManager
if
(
null
!==
$tableColumn
[
'default'
])
{
if
(
null
!==
$tableColumn
[
'default'
])
{
// Strip quotes from default value.
// Strip quotes from default value.
$default
=
preg_replace
(
array
(
"/^'(.*)'$/"
,
"/''/"
),
array
(
"$1"
,
"'"
)
,
$tableColumn
[
'default'
]);
$default
=
preg_replace
(
[
"/^'(.*)'$/"
,
"/''/"
],
[
"$1"
,
"'"
]
,
$tableColumn
[
'default'
]);
if
(
'autoincrement'
==
$default
)
{
if
(
'autoincrement'
==
$default
)
{
$default
=
null
;
$default
=
null
;
...
@@ -135,7 +135,7 @@ class SQLAnywhereSchemaManager extends AbstractSchemaManager
...
@@ -135,7 +135,7 @@ class SQLAnywhereSchemaManager extends AbstractSchemaManager
return
new
Column
(
return
new
Column
(
$tableColumn
[
'column_name'
],
$tableColumn
[
'column_name'
],
Type
::
getType
(
$type
),
Type
::
getType
(
$type
),
array
(
[
'length'
=>
$type
==
'string'
?
$tableColumn
[
'length'
]
:
null
,
'length'
=>
$type
==
'string'
?
$tableColumn
[
'length'
]
:
null
,
'precision'
=>
$precision
,
'precision'
=>
$precision
,
'scale'
=>
$scale
,
'scale'
=>
$scale
,
...
@@ -147,7 +147,8 @@ class SQLAnywhereSchemaManager extends AbstractSchemaManager
...
@@ -147,7 +147,8 @@ class SQLAnywhereSchemaManager extends AbstractSchemaManager
'comment'
=>
isset
(
$tableColumn
[
'comment'
])
&&
''
!==
$tableColumn
[
'comment'
]
'comment'
=>
isset
(
$tableColumn
[
'comment'
])
&&
''
!==
$tableColumn
[
'comment'
]
?
$tableColumn
[
'comment'
]
?
$tableColumn
[
'comment'
]
:
null
,
:
null
,
));
]
);
}
}
/**
/**
...
@@ -177,16 +178,16 @@ class SQLAnywhereSchemaManager extends AbstractSchemaManager
...
@@ -177,16 +178,16 @@ class SQLAnywhereSchemaManager extends AbstractSchemaManager
*/
*/
protected
function
_getPortableTableForeignKeysList
(
$tableForeignKeys
)
protected
function
_getPortableTableForeignKeysList
(
$tableForeignKeys
)
{
{
$foreignKeys
=
array
()
;
$foreignKeys
=
[]
;
foreach
(
$tableForeignKeys
as
$tableForeignKey
)
{
foreach
(
$tableForeignKeys
as
$tableForeignKey
)
{
if
(
!
isset
(
$foreignKeys
[
$tableForeignKey
[
'index_name'
]]))
{
if
(
!
isset
(
$foreignKeys
[
$tableForeignKey
[
'index_name'
]]))
{
$foreignKeys
[
$tableForeignKey
[
'index_name'
]]
=
array
(
$foreignKeys
[
$tableForeignKey
[
'index_name'
]]
=
[
'local_columns'
=>
array
(
$tableForeignKey
[
'local_column'
])
,
'local_columns'
=>
[
$tableForeignKey
[
'local_column'
]]
,
'foreign_table'
=>
$tableForeignKey
[
'foreign_table'
],
'foreign_table'
=>
$tableForeignKey
[
'foreign_table'
],
'foreign_columns'
=>
array
(
$tableForeignKey
[
'foreign_column'
])
,
'foreign_columns'
=>
[
$tableForeignKey
[
'foreign_column'
]]
,
'name'
=>
$tableForeignKey
[
'index_name'
],
'name'
=>
$tableForeignKey
[
'index_name'
],
'options'
=>
array
(
'options'
=>
[
'notnull'
=>
$tableForeignKey
[
'notnull'
],
'notnull'
=>
$tableForeignKey
[
'notnull'
],
'match'
=>
$tableForeignKey
[
'match'
],
'match'
=>
$tableForeignKey
[
'match'
],
'onUpdate'
=>
$tableForeignKey
[
'on_update'
],
'onUpdate'
=>
$tableForeignKey
[
'on_update'
],
...
@@ -194,8 +195,8 @@ class SQLAnywhereSchemaManager extends AbstractSchemaManager
...
@@ -194,8 +195,8 @@ class SQLAnywhereSchemaManager extends AbstractSchemaManager
'check_on_commit'
=>
$tableForeignKey
[
'check_on_commit'
],
'check_on_commit'
=>
$tableForeignKey
[
'check_on_commit'
],
'clustered'
=>
$tableForeignKey
[
'clustered'
],
'clustered'
=>
$tableForeignKey
[
'clustered'
],
'for_olap_workload'
=>
$tableForeignKey
[
'for_olap_workload'
]
'for_olap_workload'
=>
$tableForeignKey
[
'for_olap_workload'
]
)
]
)
;
]
;
}
else
{
}
else
{
$foreignKeys
[
$tableForeignKey
[
'index_name'
]][
'local_columns'
][]
=
$tableForeignKey
[
'local_column'
];
$foreignKeys
[
$tableForeignKey
[
'index_name'
]][
'local_columns'
][]
=
$tableForeignKey
[
'local_column'
];
$foreignKeys
[
$tableForeignKey
[
'index_name'
]][
'foreign_columns'
][]
=
$tableForeignKey
[
'foreign_column'
];
$foreignKeys
[
$tableForeignKey
[
'index_name'
]][
'foreign_columns'
][]
=
$tableForeignKey
[
'foreign_column'
];
...
@@ -212,7 +213,7 @@ class SQLAnywhereSchemaManager extends AbstractSchemaManager
...
@@ -212,7 +213,7 @@ class SQLAnywhereSchemaManager extends AbstractSchemaManager
{
{
foreach
(
$tableIndexRows
as
&
$tableIndex
)
{
foreach
(
$tableIndexRows
as
&
$tableIndex
)
{
$tableIndex
[
'primary'
]
=
(
boolean
)
$tableIndex
[
'primary'
];
$tableIndex
[
'primary'
]
=
(
boolean
)
$tableIndex
[
'primary'
];
$tableIndex
[
'flags'
]
=
array
()
;
$tableIndex
[
'flags'
]
=
[]
;
if
(
$tableIndex
[
'clustered'
])
{
if
(
$tableIndex
[
'clustered'
])
{
$tableIndex
[
'flags'
][]
=
'clustered'
;
$tableIndex
[
'flags'
][]
=
'clustered'
;
...
...
lib/Doctrine/DBAL/Schema/SQLServerSchemaManager.php
View file @
80f42dc7
...
@@ -116,8 +116,8 @@ class SQLServerSchemaManager extends AbstractSchemaManager
...
@@ -116,8 +116,8 @@ class SQLServerSchemaManager extends AbstractSchemaManager
$type
=
$this
->
extractDoctrineTypeFromComment
(
$tableColumn
[
'comment'
],
$type
);
$type
=
$this
->
extractDoctrineTypeFromComment
(
$tableColumn
[
'comment'
],
$type
);
$tableColumn
[
'comment'
]
=
$this
->
removeDoctrineTypeFromComment
(
$tableColumn
[
'comment'
],
$type
);
$tableColumn
[
'comment'
]
=
$this
->
removeDoctrineTypeFromComment
(
$tableColumn
[
'comment'
],
$type
);
$options
=
array
(
$options
=
[
'length'
=>
(
$length
==
0
||
!
in_array
(
$type
,
array
(
'text'
,
'string'
)
))
?
null
:
$length
,
'length'
=>
(
$length
==
0
||
!
in_array
(
$type
,
[
'text'
,
'string'
]
))
?
null
:
$length
,
'unsigned'
=>
false
,
'unsigned'
=>
false
,
'fixed'
=>
(
bool
)
$fixed
,
'fixed'
=>
(
bool
)
$fixed
,
'default'
=>
$default
!==
'NULL'
?
$default
:
null
,
'default'
=>
$default
!==
'NULL'
?
$default
:
null
,
...
@@ -126,7 +126,7 @@ class SQLServerSchemaManager extends AbstractSchemaManager
...
@@ -126,7 +126,7 @@ class SQLServerSchemaManager extends AbstractSchemaManager
'precision'
=>
$tableColumn
[
'precision'
],
'precision'
=>
$tableColumn
[
'precision'
],
'autoincrement'
=>
(
bool
)
$tableColumn
[
'autoincrement'
],
'autoincrement'
=>
(
bool
)
$tableColumn
[
'autoincrement'
],
'comment'
=>
$tableColumn
[
'comment'
]
!==
''
?
$tableColumn
[
'comment'
]
:
null
,
'comment'
=>
$tableColumn
[
'comment'
]
!==
''
?
$tableColumn
[
'comment'
]
:
null
,
)
;
]
;
$column
=
new
Column
(
$tableColumn
[
'name'
],
Type
::
getType
(
$type
),
$options
);
$column
=
new
Column
(
$tableColumn
[
'name'
],
Type
::
getType
(
$type
),
$options
);
...
@@ -142,20 +142,20 @@ class SQLServerSchemaManager extends AbstractSchemaManager
...
@@ -142,20 +142,20 @@ class SQLServerSchemaManager extends AbstractSchemaManager
*/
*/
protected
function
_getPortableTableForeignKeysList
(
$tableForeignKeys
)
protected
function
_getPortableTableForeignKeysList
(
$tableForeignKeys
)
{
{
$foreignKeys
=
array
()
;
$foreignKeys
=
[]
;
foreach
(
$tableForeignKeys
as
$tableForeignKey
)
{
foreach
(
$tableForeignKeys
as
$tableForeignKey
)
{
if
(
!
isset
(
$foreignKeys
[
$tableForeignKey
[
'ForeignKey'
]]))
{
if
(
!
isset
(
$foreignKeys
[
$tableForeignKey
[
'ForeignKey'
]]))
{
$foreignKeys
[
$tableForeignKey
[
'ForeignKey'
]]
=
array
(
$foreignKeys
[
$tableForeignKey
[
'ForeignKey'
]]
=
[
'local_columns'
=>
array
(
$tableForeignKey
[
'ColumnName'
])
,
'local_columns'
=>
[
$tableForeignKey
[
'ColumnName'
]]
,
'foreign_table'
=>
$tableForeignKey
[
'ReferenceTableName'
],
'foreign_table'
=>
$tableForeignKey
[
'ReferenceTableName'
],
'foreign_columns'
=>
array
(
$tableForeignKey
[
'ReferenceColumnName'
])
,
'foreign_columns'
=>
[
$tableForeignKey
[
'ReferenceColumnName'
]]
,
'name'
=>
$tableForeignKey
[
'ForeignKey'
],
'name'
=>
$tableForeignKey
[
'ForeignKey'
],
'options'
=>
array
(
'options'
=>
[
'onUpdate'
=>
str_replace
(
'_'
,
' '
,
$tableForeignKey
[
'update_referential_action_desc'
]),
'onUpdate'
=>
str_replace
(
'_'
,
' '
,
$tableForeignKey
[
'update_referential_action_desc'
]),
'onDelete'
=>
str_replace
(
'_'
,
' '
,
$tableForeignKey
[
'delete_referential_action_desc'
])
'onDelete'
=>
str_replace
(
'_'
,
' '
,
$tableForeignKey
[
'delete_referential_action_desc'
])
)
]
)
;
]
;
}
else
{
}
else
{
$foreignKeys
[
$tableForeignKey
[
'ForeignKey'
]][
'local_columns'
][]
=
$tableForeignKey
[
'ColumnName'
];
$foreignKeys
[
$tableForeignKey
[
'ForeignKey'
]][
'local_columns'
][]
=
$tableForeignKey
[
'ColumnName'
];
$foreignKeys
[
$tableForeignKey
[
'ForeignKey'
]][
'foreign_columns'
][]
=
$tableForeignKey
[
'ReferenceColumnName'
];
$foreignKeys
[
$tableForeignKey
[
'ForeignKey'
]][
'foreign_columns'
][]
=
$tableForeignKey
[
'ReferenceColumnName'
];
...
@@ -173,7 +173,7 @@ class SQLServerSchemaManager extends AbstractSchemaManager
...
@@ -173,7 +173,7 @@ class SQLServerSchemaManager extends AbstractSchemaManager
foreach
(
$tableIndexRows
as
&
$tableIndex
)
{
foreach
(
$tableIndexRows
as
&
$tableIndex
)
{
$tableIndex
[
'non_unique'
]
=
(
boolean
)
$tableIndex
[
'non_unique'
];
$tableIndex
[
'non_unique'
]
=
(
boolean
)
$tableIndex
[
'non_unique'
];
$tableIndex
[
'primary'
]
=
(
boolean
)
$tableIndex
[
'primary'
];
$tableIndex
[
'primary'
]
=
(
boolean
)
$tableIndex
[
'primary'
];
$tableIndex
[
'flags'
]
=
$tableIndex
[
'flags'
]
?
array
(
$tableIndex
[
'flags'
])
:
null
;
$tableIndex
[
'flags'
]
=
$tableIndex
[
'flags'
]
?
[
$tableIndex
[
'flags'
]]
:
null
;
}
}
return
parent
::
_getPortableTableIndexesList
(
$tableIndexRows
,
$tableName
);
return
parent
::
_getPortableTableIndexesList
(
$tableIndexRows
,
$tableName
);
...
@@ -237,13 +237,13 @@ class SQLServerSchemaManager extends AbstractSchemaManager
...
@@ -237,13 +237,13 @@ class SQLServerSchemaManager extends AbstractSchemaManager
$tableIndexes
=
$this
->
_conn
->
fetchAll
(
$sql
);
$tableIndexes
=
$this
->
_conn
->
fetchAll
(
$sql
);
}
catch
(
\PDOException
$e
)
{
}
catch
(
\PDOException
$e
)
{
if
(
$e
->
getCode
()
==
"IMSSP"
)
{
if
(
$e
->
getCode
()
==
"IMSSP"
)
{
return
array
()
;
return
[]
;
}
else
{
}
else
{
throw
$e
;
throw
$e
;
}
}
}
catch
(
DBALException
$e
)
{
}
catch
(
DBALException
$e
)
{
if
(
strpos
(
$e
->
getMessage
(),
'SQLSTATE [01000, 15472]'
)
===
0
)
{
if
(
strpos
(
$e
->
getMessage
(),
'SQLSTATE [01000, 15472]'
)
===
0
)
{
return
array
()
;
return
[]
;
}
else
{
}
else
{
throw
$e
;
throw
$e
;
}
}
...
...
lib/Doctrine/DBAL/Schema/Schema.php
View file @
80f42dc7
...
@@ -60,17 +60,17 @@ class Schema extends AbstractAsset
...
@@ -60,17 +60,17 @@ class Schema extends AbstractAsset
*
*
* @var array
* @var array
*/
*/
private
$namespaces
=
array
()
;
private
$namespaces
=
[]
;
/**
/**
* @var \Doctrine\DBAL\Schema\Table[]
* @var \Doctrine\DBAL\Schema\Table[]
*/
*/
protected
$_tables
=
array
()
;
protected
$_tables
=
[]
;
/**
/**
* @var \Doctrine\DBAL\Schema\Sequence[]
* @var \Doctrine\DBAL\Schema\Sequence[]
*/
*/
protected
$_sequences
=
array
()
;
protected
$_sequences
=
[]
;
/**
/**
* @var \Doctrine\DBAL\Schema\SchemaConfig
* @var \Doctrine\DBAL\Schema\SchemaConfig
...
@@ -84,10 +84,10 @@ class Schema extends AbstractAsset
...
@@ -84,10 +84,10 @@ class Schema extends AbstractAsset
* @param array $namespaces
* @param array $namespaces
*/
*/
public
function
__construct
(
public
function
__construct
(
array
$tables
=
array
()
,
array
$tables
=
[]
,
array
$sequences
=
array
()
,
array
$sequences
=
[]
,
SchemaConfig
$schemaConfig
=
null
,
SchemaConfig
$schemaConfig
=
null
,
array
$namespaces
=
array
()
array
$namespaces
=
[]
)
{
)
{
if
(
$schemaConfig
==
null
)
{
if
(
$schemaConfig
==
null
)
{
$schemaConfig
=
new
SchemaConfig
();
$schemaConfig
=
new
SchemaConfig
();
...
...
lib/Doctrine/DBAL/Schema/SchemaConfig.php
View file @
80f42dc7
...
@@ -46,7 +46,7 @@ class SchemaConfig
...
@@ -46,7 +46,7 @@ class SchemaConfig
/**
/**
* @var array
* @var array
*/
*/
protected
$defaultTableOptions
=
array
()
;
protected
$defaultTableOptions
=
[]
;
/**
/**
* @return boolean
* @return boolean
...
...
lib/Doctrine/DBAL/Schema/SchemaDiff.php
View file @
80f42dc7
...
@@ -42,55 +42,55 @@ class SchemaDiff
...
@@ -42,55 +42,55 @@ class SchemaDiff
*
*
* @var string[]
* @var string[]
*/
*/
public
$newNamespaces
=
array
()
;
public
$newNamespaces
=
[]
;
/**
/**
* All removed namespaces.
* All removed namespaces.
*
*
* @var string[]
* @var string[]
*/
*/
public
$removedNamespaces
=
array
()
;
public
$removedNamespaces
=
[]
;
/**
/**
* All added tables.
* All added tables.
*
*
* @var \Doctrine\DBAL\Schema\Table[]
* @var \Doctrine\DBAL\Schema\Table[]
*/
*/
public
$newTables
=
array
()
;
public
$newTables
=
[]
;
/**
/**
* All changed tables.
* All changed tables.
*
*
* @var \Doctrine\DBAL\Schema\TableDiff[]
* @var \Doctrine\DBAL\Schema\TableDiff[]
*/
*/
public
$changedTables
=
array
()
;
public
$changedTables
=
[]
;
/**
/**
* All removed tables.
* All removed tables.
*
*
* @var \Doctrine\DBAL\Schema\Table[]
* @var \Doctrine\DBAL\Schema\Table[]
*/
*/
public
$removedTables
=
array
()
;
public
$removedTables
=
[]
;
/**
/**
* @var \Doctrine\DBAL\Schema\Sequence[]
* @var \Doctrine\DBAL\Schema\Sequence[]
*/
*/
public
$newSequences
=
array
()
;
public
$newSequences
=
[]
;
/**
/**
* @var \Doctrine\DBAL\Schema\Sequence[]
* @var \Doctrine\DBAL\Schema\Sequence[]
*/
*/
public
$changedSequences
=
array
()
;
public
$changedSequences
=
[]
;
/**
/**
* @var \Doctrine\DBAL\Schema\Sequence[]
* @var \Doctrine\DBAL\Schema\Sequence[]
*/
*/
public
$removedSequences
=
array
()
;
public
$removedSequences
=
[]
;
/**
/**
* @var \Doctrine\DBAL\Schema\ForeignKeyConstraint[]
* @var \Doctrine\DBAL\Schema\ForeignKeyConstraint[]
*/
*/
public
$orphanedForeignKeys
=
array
()
;
public
$orphanedForeignKeys
=
[]
;
/**
/**
* Constructs an SchemaDiff object.
* Constructs an SchemaDiff object.
...
@@ -100,7 +100,7 @@ class SchemaDiff
...
@@ -100,7 +100,7 @@ class SchemaDiff
* @param \Doctrine\DBAL\Schema\Table[] $removedTables
* @param \Doctrine\DBAL\Schema\Table[] $removedTables
* @param \Doctrine\DBAL\Schema\Schema|null $fromSchema
* @param \Doctrine\DBAL\Schema\Schema|null $fromSchema
*/
*/
public
function
__construct
(
$newTables
=
array
(),
$changedTables
=
array
(),
$removedTables
=
array
()
,
Schema
$fromSchema
=
null
)
public
function
__construct
(
$newTables
=
[],
$changedTables
=
[],
$removedTables
=
[]
,
Schema
$fromSchema
=
null
)
{
{
$this
->
newTables
=
$newTables
;
$this
->
newTables
=
$newTables
;
$this
->
changedTables
=
$changedTables
;
$this
->
changedTables
=
$changedTables
;
...
@@ -144,7 +144,7 @@ class SchemaDiff
...
@@ -144,7 +144,7 @@ class SchemaDiff
*/
*/
protected
function
_toSql
(
AbstractPlatform
$platform
,
$saveMode
=
false
)
protected
function
_toSql
(
AbstractPlatform
$platform
,
$saveMode
=
false
)
{
{
$sql
=
array
()
;
$sql
=
[]
;
if
(
$platform
->
supportsSchemas
())
{
if
(
$platform
->
supportsSchemas
())
{
foreach
(
$this
->
newNamespaces
as
$newNamespace
)
{
foreach
(
$this
->
newNamespaces
as
$newNamespace
)
{
...
@@ -174,7 +174,7 @@ class SchemaDiff
...
@@ -174,7 +174,7 @@ class SchemaDiff
}
}
}
}
$foreignKeySql
=
array
()
;
$foreignKeySql
=
[]
;
foreach
(
$this
->
newTables
as
$table
)
{
foreach
(
$this
->
newTables
as
$table
)
{
$sql
=
array_merge
(
$sql
=
array_merge
(
$sql
,
$sql
,
...
...
lib/Doctrine/DBAL/Schema/SqliteSchemaManager.php
View file @
80f42dc7
...
@@ -52,10 +52,10 @@ class SqliteSchemaManager extends AbstractSchemaManager
...
@@ -52,10 +52,10 @@ class SqliteSchemaManager extends AbstractSchemaManager
{
{
$params
=
$this
->
_conn
->
getParams
();
$params
=
$this
->
_conn
->
getParams
();
$driver
=
$params
[
'driver'
];
$driver
=
$params
[
'driver'
];
$options
=
array
(
$options
=
[
'driver'
=>
$driver
,
'driver'
=>
$driver
,
'path'
=>
$database
'path'
=>
$database
)
;
]
;
$conn
=
\Doctrine\DBAL\DriverManager
::
getConnection
(
$options
);
$conn
=
\Doctrine\DBAL\DriverManager
::
getConnection
(
$options
);
$conn
->
connect
();
$conn
->
connect
();
$conn
->
close
();
$conn
->
close
();
...
@@ -135,7 +135,7 @@ class SqliteSchemaManager extends AbstractSchemaManager
...
@@ -135,7 +135,7 @@ class SqliteSchemaManager extends AbstractSchemaManager
$deferrable
=
array_reverse
(
$match
[
2
]);
$deferrable
=
array_reverse
(
$match
[
2
]);
$deferred
=
array_reverse
(
$match
[
3
]);
$deferred
=
array_reverse
(
$match
[
3
]);
}
else
{
}
else
{
$names
=
$deferrable
=
$deferred
=
array
()
;
$names
=
$deferrable
=
$deferred
=
[]
;
}
}
foreach
(
$tableForeignKeys
as
$key
=>
$value
)
{
foreach
(
$tableForeignKeys
as
$key
=>
$value
)
{
...
@@ -165,7 +165,7 @@ class SqliteSchemaManager extends AbstractSchemaManager
...
@@ -165,7 +165,7 @@ class SqliteSchemaManager extends AbstractSchemaManager
*/
*/
protected
function
_getPortableTableIndexesList
(
$tableIndexes
,
$tableName
=
null
)
protected
function
_getPortableTableIndexesList
(
$tableIndexes
,
$tableName
=
null
)
{
{
$indexBuffer
=
array
()
;
$indexBuffer
=
[]
;
// fetch primary
// fetch primary
$stmt
=
$this
->
_conn
->
executeQuery
(
"PRAGMA TABLE_INFO ('
$tableName
')"
);
$stmt
=
$this
->
_conn
->
executeQuery
(
"PRAGMA TABLE_INFO ('
$tableName
')"
);
...
@@ -180,12 +180,12 @@ class SqliteSchemaManager extends AbstractSchemaManager
...
@@ -180,12 +180,12 @@ class SqliteSchemaManager extends AbstractSchemaManager
});
});
foreach
(
$indexArray
as
$indexColumnRow
)
{
foreach
(
$indexArray
as
$indexColumnRow
)
{
if
(
$indexColumnRow
[
'pk'
]
!=
"0"
)
{
if
(
$indexColumnRow
[
'pk'
]
!=
"0"
)
{
$indexBuffer
[]
=
array
(
$indexBuffer
[]
=
[
'key_name'
=>
'primary'
,
'key_name'
=>
'primary'
,
'primary'
=>
true
,
'primary'
=>
true
,
'non_unique'
=>
false
,
'non_unique'
=>
false
,
'column_name'
=>
$indexColumnRow
[
'name'
]
'column_name'
=>
$indexColumnRow
[
'name'
]
)
;
]
;
}
}
}
}
...
@@ -194,7 +194,7 @@ class SqliteSchemaManager extends AbstractSchemaManager
...
@@ -194,7 +194,7 @@ class SqliteSchemaManager extends AbstractSchemaManager
// Ignore indexes with reserved names, e.g. autoindexes
// Ignore indexes with reserved names, e.g. autoindexes
if
(
strpos
(
$tableIndex
[
'name'
],
'sqlite_'
)
!==
0
)
{
if
(
strpos
(
$tableIndex
[
'name'
],
'sqlite_'
)
!==
0
)
{
$keyName
=
$tableIndex
[
'name'
];
$keyName
=
$tableIndex
[
'name'
];
$idx
=
array
()
;
$idx
=
[]
;
$idx
[
'key_name'
]
=
$keyName
;
$idx
[
'key_name'
]
=
$keyName
;
$idx
[
'primary'
]
=
false
;
$idx
[
'primary'
]
=
false
;
$idx
[
'non_unique'
]
=
$tableIndex
[
'unique'
]
?
false
:
true
;
$idx
[
'non_unique'
]
=
$tableIndex
[
'unique'
]
?
false
:
true
;
...
@@ -217,10 +217,10 @@ class SqliteSchemaManager extends AbstractSchemaManager
...
@@ -217,10 +217,10 @@ class SqliteSchemaManager extends AbstractSchemaManager
*/
*/
protected
function
_getPortableTableIndexDefinition
(
$tableIndex
)
protected
function
_getPortableTableIndexDefinition
(
$tableIndex
)
{
{
return
array
(
return
[
'name'
=>
$tableIndex
[
'name'
],
'name'
=>
$tableIndex
[
'name'
],
'unique'
=>
(
bool
)
$tableIndex
[
'unique'
]
'unique'
=>
(
bool
)
$tableIndex
[
'unique'
]
)
;
]
;
}
}
/**
/**
...
@@ -339,7 +339,7 @@ class SqliteSchemaManager extends AbstractSchemaManager
...
@@ -339,7 +339,7 @@ class SqliteSchemaManager extends AbstractSchemaManager
break
;
break
;
}
}
$options
=
array
(
$options
=
[
'length'
=>
$length
,
'length'
=>
$length
,
'unsigned'
=>
(
bool
)
$unsigned
,
'unsigned'
=>
(
bool
)
$unsigned
,
'fixed'
=>
$fixed
,
'fixed'
=>
$fixed
,
...
@@ -348,7 +348,7 @@ class SqliteSchemaManager extends AbstractSchemaManager
...
@@ -348,7 +348,7 @@ class SqliteSchemaManager extends AbstractSchemaManager
'precision'
=>
$precision
,
'precision'
=>
$precision
,
'scale'
=>
$scale
,
'scale'
=>
$scale
,
'autoincrement'
=>
false
,
'autoincrement'
=>
false
,
)
;
]
;
return
new
Column
(
$tableColumn
[
'name'
],
\Doctrine\DBAL\Types\Type
::
getType
(
$type
),
$options
);
return
new
Column
(
$tableColumn
[
'name'
],
\Doctrine\DBAL\Types\Type
::
getType
(
$type
),
$options
);
}
}
...
@@ -366,7 +366,7 @@ class SqliteSchemaManager extends AbstractSchemaManager
...
@@ -366,7 +366,7 @@ class SqliteSchemaManager extends AbstractSchemaManager
*/
*/
protected
function
_getPortableTableForeignKeysList
(
$tableForeignKeys
)
protected
function
_getPortableTableForeignKeysList
(
$tableForeignKeys
)
{
{
$list
=
array
()
;
$list
=
[]
;
foreach
(
$tableForeignKeys
as
$value
)
{
foreach
(
$tableForeignKeys
as
$value
)
{
$value
=
array_change_key_case
(
$value
,
CASE_LOWER
);
$value
=
array_change_key_case
(
$value
,
CASE_LOWER
);
$name
=
$value
[
'constraint_name'
];
$name
=
$value
[
'constraint_name'
];
...
@@ -378,32 +378,32 @@ class SqliteSchemaManager extends AbstractSchemaManager
...
@@ -378,32 +378,32 @@ class SqliteSchemaManager extends AbstractSchemaManager
$value
[
'on_update'
]
=
null
;
$value
[
'on_update'
]
=
null
;
}
}
$list
[
$name
]
=
array
(
$list
[
$name
]
=
[
'name'
=>
$name
,
'name'
=>
$name
,
'local'
=>
array
()
,
'local'
=>
[]
,
'foreign'
=>
array
()
,
'foreign'
=>
[]
,
'foreignTable'
=>
$value
[
'table'
],
'foreignTable'
=>
$value
[
'table'
],
'onDelete'
=>
$value
[
'on_delete'
],
'onDelete'
=>
$value
[
'on_delete'
],
'onUpdate'
=>
$value
[
'on_update'
],
'onUpdate'
=>
$value
[
'on_update'
],
'deferrable'
=>
$value
[
'deferrable'
],
'deferrable'
=>
$value
[
'deferrable'
],
'deferred'
=>
$value
[
'deferred'
],
'deferred'
=>
$value
[
'deferred'
],
)
;
]
;
}
}
$list
[
$name
][
'local'
][]
=
$value
[
'from'
];
$list
[
$name
][
'local'
][]
=
$value
[
'from'
];
$list
[
$name
][
'foreign'
][]
=
$value
[
'to'
];
$list
[
$name
][
'foreign'
][]
=
$value
[
'to'
];
}
}
$result
=
array
()
;
$result
=
[]
;
foreach
(
$list
as
$constraint
)
{
foreach
(
$list
as
$constraint
)
{
$result
[]
=
new
ForeignKeyConstraint
(
$result
[]
=
new
ForeignKeyConstraint
(
array_values
(
$constraint
[
'local'
]),
$constraint
[
'foreignTable'
],
array_values
(
$constraint
[
'local'
]),
$constraint
[
'foreignTable'
],
array_values
(
$constraint
[
'foreign'
]),
$constraint
[
'name'
],
array_values
(
$constraint
[
'foreign'
]),
$constraint
[
'name'
],
array
(
[
'onDelete'
=>
$constraint
[
'onDelete'
],
'onDelete'
=>
$constraint
[
'onDelete'
],
'onUpdate'
=>
$constraint
[
'onUpdate'
],
'onUpdate'
=>
$constraint
[
'onUpdate'
],
'deferrable'
=>
$constraint
[
'deferrable'
],
'deferrable'
=>
$constraint
[
'deferrable'
],
'deferred'
=>
$constraint
[
'deferred'
],
'deferred'
=>
$constraint
[
'deferred'
],
)
]
);
);
}
}
...
...
lib/Doctrine/DBAL/Schema/Table.php
View file @
80f42dc7
...
@@ -40,17 +40,17 @@ class Table extends AbstractAsset
...
@@ -40,17 +40,17 @@ class Table extends AbstractAsset
/**
/**
* @var Column[]
* @var Column[]
*/
*/
protected
$_columns
=
array
()
;
protected
$_columns
=
[]
;
/**
/**
* @var Index[]
* @var Index[]
*/
*/
private
$implicitIndexes
=
array
()
;
private
$implicitIndexes
=
[]
;
/**
/**
* @var Index[]
* @var Index[]
*/
*/
protected
$_indexes
=
array
()
;
protected
$_indexes
=
[]
;
/**
/**
* @var string
* @var string
...
@@ -60,12 +60,12 @@ class Table extends AbstractAsset
...
@@ -60,12 +60,12 @@ class Table extends AbstractAsset
/**
/**
* @var ForeignKeyConstraint[]
* @var ForeignKeyConstraint[]
*/
*/
protected
$_fkConstraints
=
array
()
;
protected
$_fkConstraints
=
[]
;
/**
/**
* @var array
* @var array
*/
*/
protected
$_options
=
array
()
;
protected
$_options
=
[]
;
/**
/**
* @var SchemaConfig
* @var SchemaConfig
...
@@ -82,7 +82,7 @@ class Table extends AbstractAsset
...
@@ -82,7 +82,7 @@ class Table extends AbstractAsset
*
*
* @throws DBALException
* @throws DBALException
*/
*/
public
function
__construct
(
$tableName
,
array
$columns
=
array
(),
array
$indexes
=
array
(),
array
$fkConstraints
=
array
(),
$idGeneratorType
=
0
,
array
$options
=
array
()
)
public
function
__construct
(
$tableName
,
array
$columns
=
[],
array
$indexes
=
[],
array
$fkConstraints
=
[],
$idGeneratorType
=
0
,
array
$options
=
[]
)
{
{
if
(
strlen
(
$tableName
)
==
0
)
{
if
(
strlen
(
$tableName
)
==
0
)
{
throw
DBALException
::
invalidTableName
(
$tableName
);
throw
DBALException
::
invalidTableName
(
$tableName
);
...
@@ -155,11 +155,11 @@ class Table extends AbstractAsset
...
@@ -155,11 +155,11 @@ class Table extends AbstractAsset
*
*
* @return self
* @return self
*/
*/
public
function
addIndex
(
array
$columnNames
,
$indexName
=
null
,
array
$flags
=
array
(),
array
$options
=
array
()
)
public
function
addIndex
(
array
$columnNames
,
$indexName
=
null
,
array
$flags
=
[],
array
$options
=
[]
)
{
{
if
(
$indexName
==
null
)
{
if
(
$indexName
==
null
)
{
$indexName
=
$this
->
_generateIdentifierName
(
$indexName
=
$this
->
_generateIdentifierName
(
array_merge
(
array
(
$this
->
getName
())
,
$columnNames
),
"idx"
,
$this
->
_getMaxIdentifierLength
()
array_merge
(
[
$this
->
getName
()]
,
$columnNames
),
"idx"
,
$this
->
_getMaxIdentifierLength
()
);
);
}
}
...
@@ -202,15 +202,15 @@ class Table extends AbstractAsset
...
@@ -202,15 +202,15 @@ class Table extends AbstractAsset
*
*
* @return self
* @return self
*/
*/
public
function
addUniqueIndex
(
array
$columnNames
,
$indexName
=
null
,
array
$options
=
array
()
)
public
function
addUniqueIndex
(
array
$columnNames
,
$indexName
=
null
,
array
$options
=
[]
)
{
{
if
(
$indexName
===
null
)
{
if
(
$indexName
===
null
)
{
$indexName
=
$this
->
_generateIdentifierName
(
$indexName
=
$this
->
_generateIdentifierName
(
array_merge
(
array
(
$this
->
getName
())
,
$columnNames
),
"uniq"
,
$this
->
_getMaxIdentifierLength
()
array_merge
(
[
$this
->
getName
()]
,
$columnNames
),
"uniq"
,
$this
->
_getMaxIdentifierLength
()
);
);
}
}
return
$this
->
_addIndex
(
$this
->
_createIndex
(
$columnNames
,
$indexName
,
true
,
false
,
array
()
,
$options
));
return
$this
->
_addIndex
(
$this
->
_createIndex
(
$columnNames
,
$indexName
,
true
,
false
,
[]
,
$options
));
}
}
/**
/**
...
@@ -290,7 +290,7 @@ class Table extends AbstractAsset
...
@@ -290,7 +290,7 @@ class Table extends AbstractAsset
*
*
* @throws SchemaException
* @throws SchemaException
*/
*/
private
function
_createIndex
(
array
$columnNames
,
$indexName
,
$isUnique
,
$isPrimary
,
array
$flags
=
array
(),
array
$options
=
array
()
)
private
function
_createIndex
(
array
$columnNames
,
$indexName
,
$isUnique
,
$isPrimary
,
array
$flags
=
[],
array
$options
=
[]
)
{
{
if
(
preg_match
(
'(([^a-zA-Z0-9_]+))'
,
$this
->
normalizeIdentifier
(
$indexName
)))
{
if
(
preg_match
(
'(([^a-zA-Z0-9_]+))'
,
$this
->
normalizeIdentifier
(
$indexName
)))
{
throw
SchemaException
::
indexNameInvalid
(
$indexName
);
throw
SchemaException
::
indexNameInvalid
(
$indexName
);
...
@@ -316,7 +316,7 @@ class Table extends AbstractAsset
...
@@ -316,7 +316,7 @@ class Table extends AbstractAsset
*
*
* @return Column
* @return Column
*/
*/
public
function
addColumn
(
$columnName
,
$typeName
,
array
$options
=
array
()
)
public
function
addColumn
(
$columnName
,
$typeName
,
array
$options
=
[]
)
{
{
$column
=
new
Column
(
$columnName
,
Type
::
getType
(
$typeName
),
$options
);
$column
=
new
Column
(
$columnName
,
Type
::
getType
(
$typeName
),
$options
);
...
@@ -386,7 +386,7 @@ class Table extends AbstractAsset
...
@@ -386,7 +386,7 @@ class Table extends AbstractAsset
*
*
* @return self
* @return self
*/
*/
public
function
addForeignKeyConstraint
(
$foreignTable
,
array
$localColumnNames
,
array
$foreignColumnNames
,
array
$options
=
array
()
,
$constraintName
=
null
)
public
function
addForeignKeyConstraint
(
$foreignTable
,
array
$localColumnNames
,
array
$foreignColumnNames
,
array
$options
=
[]
,
$constraintName
=
null
)
{
{
$constraintName
=
$constraintName
?:
$this
->
_generateIdentifierName
(
array_merge
((
array
)
$this
->
getName
(),
$localColumnNames
),
"fk"
,
$this
->
_getMaxIdentifierLength
());
$constraintName
=
$constraintName
?:
$this
->
_generateIdentifierName
(
array_merge
((
array
)
$this
->
getName
(),
$localColumnNames
),
"fk"
,
$this
->
_getMaxIdentifierLength
());
...
@@ -407,7 +407,7 @@ class Table extends AbstractAsset
...
@@ -407,7 +407,7 @@ class Table extends AbstractAsset
*
*
* @return self
* @return self
*/
*/
public
function
addUnnamedForeignKeyConstraint
(
$foreignTable
,
array
$localColumnNames
,
array
$foreignColumnNames
,
array
$options
=
array
()
)
public
function
addUnnamedForeignKeyConstraint
(
$foreignTable
,
array
$localColumnNames
,
array
$foreignColumnNames
,
array
$options
=
[]
)
{
{
return
$this
->
addForeignKeyConstraint
(
$foreignTable
,
$localColumnNames
,
$foreignColumnNames
,
$options
);
return
$this
->
addForeignKeyConstraint
(
$foreignTable
,
$localColumnNames
,
$foreignColumnNames
,
$options
);
}
}
...
@@ -427,7 +427,7 @@ class Table extends AbstractAsset
...
@@ -427,7 +427,7 @@ class Table extends AbstractAsset
*
*
* @throws SchemaException
* @throws SchemaException
*/
*/
public
function
addNamedForeignKeyConstraint
(
$name
,
$foreignTable
,
array
$localColumnNames
,
array
$foreignColumnNames
,
array
$options
=
array
()
)
public
function
addNamedForeignKeyConstraint
(
$name
,
$foreignTable
,
array
$localColumnNames
,
array
$foreignColumnNames
,
array
$options
=
[]
)
{
{
if
(
$foreignTable
instanceof
Table
)
{
if
(
$foreignTable
instanceof
Table
)
{
foreach
(
$foreignColumnNames
as
$columnName
)
{
foreach
(
$foreignColumnNames
as
$columnName
)
{
...
@@ -496,7 +496,7 @@ class Table extends AbstractAsset
...
@@ -496,7 +496,7 @@ class Table extends AbstractAsset
{
{
$indexName
=
$indexCandidate
->
getName
();
$indexName
=
$indexCandidate
->
getName
();
$indexName
=
$this
->
normalizeIdentifier
(
$indexName
);
$indexName
=
$this
->
normalizeIdentifier
(
$indexName
);
$replacedImplicitIndexes
=
array
()
;
$replacedImplicitIndexes
=
[]
;
foreach
(
$this
->
implicitIndexes
as
$name
=>
$implicitIndex
)
{
foreach
(
$this
->
implicitIndexes
as
$name
=>
$implicitIndex
)
{
if
(
$implicitIndex
->
isFullfilledBy
(
$indexCandidate
)
&&
isset
(
$this
->
_indexes
[
$name
]))
{
if
(
$implicitIndex
->
isFullfilledBy
(
$indexCandidate
)
&&
isset
(
$this
->
_indexes
[
$name
]))
{
...
@@ -547,7 +547,7 @@ class Table extends AbstractAsset
...
@@ -547,7 +547,7 @@ class Table extends AbstractAsset
// In the case of __construct calling this method during hydration from schema-details all the explicitly added indexes
// In the case of __construct calling this method during hydration from schema-details all the explicitly added indexes
// lead to duplicates. This creates computation overhead in this case, however no duplicate indexes are ever added (based on columns).
// lead to duplicates. This creates computation overhead in this case, however no duplicate indexes are ever added (based on columns).
$indexName
=
$this
->
_generateIdentifierName
(
$indexName
=
$this
->
_generateIdentifierName
(
array_merge
(
array
(
$this
->
getName
())
,
$constraint
->
getColumns
()),
array_merge
(
[
$this
->
getName
()]
,
$constraint
->
getColumns
()),
"idx"
,
"idx"
,
$this
->
_getMaxIdentifierLength
()
$this
->
_getMaxIdentifierLength
()
);
);
...
...
lib/Doctrine/DBAL/Schema/TableDiff.php
View file @
80f42dc7
...
@@ -52,70 +52,70 @@ class TableDiff
...
@@ -52,70 +52,70 @@ class TableDiff
*
*
* @var \Doctrine\DBAL\Schema\ColumnDiff[]
* @var \Doctrine\DBAL\Schema\ColumnDiff[]
*/
*/
public
$changedColumns
=
array
()
;
public
$changedColumns
=
[]
;
/**
/**
* All removed fields.
* All removed fields.
*
*
* @var \Doctrine\DBAL\Schema\Column[]
* @var \Doctrine\DBAL\Schema\Column[]
*/
*/
public
$removedColumns
=
array
()
;
public
$removedColumns
=
[]
;
/**
/**
* Columns that are only renamed from key to column instance name.
* Columns that are only renamed from key to column instance name.
*
*
* @var \Doctrine\DBAL\Schema\Column[]
* @var \Doctrine\DBAL\Schema\Column[]
*/
*/
public
$renamedColumns
=
array
()
;
public
$renamedColumns
=
[]
;
/**
/**
* All added indexes.
* All added indexes.
*
*
* @var \Doctrine\DBAL\Schema\Index[]
* @var \Doctrine\DBAL\Schema\Index[]
*/
*/
public
$addedIndexes
=
array
()
;
public
$addedIndexes
=
[]
;
/**
/**
* All changed indexes.
* All changed indexes.
*
*
* @var \Doctrine\DBAL\Schema\Index[]
* @var \Doctrine\DBAL\Schema\Index[]
*/
*/
public
$changedIndexes
=
array
()
;
public
$changedIndexes
=
[]
;
/**
/**
* All removed indexes
* All removed indexes
*
*
* @var \Doctrine\DBAL\Schema\Index[]
* @var \Doctrine\DBAL\Schema\Index[]
*/
*/
public
$removedIndexes
=
array
()
;
public
$removedIndexes
=
[]
;
/**
/**
* Indexes that are only renamed but are identical otherwise.
* Indexes that are only renamed but are identical otherwise.
*
*
* @var \Doctrine\DBAL\Schema\Index[]
* @var \Doctrine\DBAL\Schema\Index[]
*/
*/
public
$renamedIndexes
=
array
()
;
public
$renamedIndexes
=
[]
;
/**
/**
* All added foreign key definitions
* All added foreign key definitions
*
*
* @var \Doctrine\DBAL\Schema\ForeignKeyConstraint[]
* @var \Doctrine\DBAL\Schema\ForeignKeyConstraint[]
*/
*/
public
$addedForeignKeys
=
array
()
;
public
$addedForeignKeys
=
[]
;
/**
/**
* All changed foreign keys
* All changed foreign keys
*
*
* @var \Doctrine\DBAL\Schema\ForeignKeyConstraint[]
* @var \Doctrine\DBAL\Schema\ForeignKeyConstraint[]
*/
*/
public
$changedForeignKeys
=
array
()
;
public
$changedForeignKeys
=
[]
;
/**
/**
* All removed foreign keys
* All removed foreign keys
*
*
* @var \Doctrine\DBAL\Schema\ForeignKeyConstraint[]
* @var \Doctrine\DBAL\Schema\ForeignKeyConstraint[]
*/
*/
public
$removedForeignKeys
=
array
()
;
public
$removedForeignKeys
=
[]
;
/**
/**
* @var \Doctrine\DBAL\Schema\Table
* @var \Doctrine\DBAL\Schema\Table
...
@@ -134,9 +134,9 @@ class TableDiff
...
@@ -134,9 +134,9 @@ class TableDiff
* @param \Doctrine\DBAL\Schema\Index[] $removedIndexes
* @param \Doctrine\DBAL\Schema\Index[] $removedIndexes
* @param \Doctrine\DBAL\Schema\Table|null $fromTable
* @param \Doctrine\DBAL\Schema\Table|null $fromTable
*/
*/
public
function
__construct
(
$tableName
,
$addedColumns
=
array
()
,
public
function
__construct
(
$tableName
,
$addedColumns
=
[]
,
$changedColumns
=
array
(),
$removedColumns
=
array
(),
$addedIndexes
=
array
()
,
$changedColumns
=
[],
$removedColumns
=
[],
$addedIndexes
=
[]
,
$changedIndexes
=
array
(),
$removedIndexes
=
array
()
,
Table
$fromTable
=
null
)
$changedIndexes
=
[],
$removedIndexes
=
[]
,
Table
$fromTable
=
null
)
{
{
$this
->
name
=
$tableName
;
$this
->
name
=
$tableName
;
$this
->
addedColumns
=
$addedColumns
;
$this
->
addedColumns
=
$addedColumns
;
...
...
lib/Doctrine/DBAL/Schema/Visitor/CreateSchemaSqlCollector.php
View file @
80f42dc7
...
@@ -29,22 +29,22 @@ class CreateSchemaSqlCollector extends AbstractVisitor
...
@@ -29,22 +29,22 @@ class CreateSchemaSqlCollector extends AbstractVisitor
/**
/**
* @var array
* @var array
*/
*/
private
$createNamespaceQueries
=
array
()
;
private
$createNamespaceQueries
=
[]
;
/**
/**
* @var array
* @var array
*/
*/
private
$createTableQueries
=
array
()
;
private
$createTableQueries
=
[]
;
/**
/**
* @var array
* @var array
*/
*/
private
$createSequenceQueries
=
array
()
;
private
$createSequenceQueries
=
[]
;
/**
/**
* @var array
* @var array
*/
*/
private
$createFkConstraintQueries
=
array
()
;
private
$createFkConstraintQueries
=
[]
;
/**
/**
*
*
...
@@ -101,10 +101,10 @@ class CreateSchemaSqlCollector extends AbstractVisitor
...
@@ -101,10 +101,10 @@ class CreateSchemaSqlCollector extends AbstractVisitor
*/
*/
public
function
resetQueries
()
public
function
resetQueries
()
{
{
$this
->
createNamespaceQueries
=
array
()
;
$this
->
createNamespaceQueries
=
[]
;
$this
->
createTableQueries
=
array
()
;
$this
->
createTableQueries
=
[]
;
$this
->
createSequenceQueries
=
array
()
;
$this
->
createSequenceQueries
=
[]
;
$this
->
createFkConstraintQueries
=
array
()
;
$this
->
createFkConstraintQueries
=
[]
;
}
}
/**
/**
...
...
lib/Doctrine/DBAL/Schema/Visitor/DropSchemaSqlCollector.php
View file @
80f42dc7
...
@@ -106,7 +106,7 @@ class DropSchemaSqlCollector extends AbstractVisitor
...
@@ -106,7 +106,7 @@ class DropSchemaSqlCollector extends AbstractVisitor
*/
*/
public
function
getQueries
()
public
function
getQueries
()
{
{
$sql
=
array
()
;
$sql
=
[]
;
foreach
(
$this
->
constraints
as
$fkConstraint
)
{
foreach
(
$this
->
constraints
as
$fkConstraint
)
{
$localTable
=
$this
->
constraints
[
$fkConstraint
];
$localTable
=
$this
->
constraints
[
$fkConstraint
];
...
...
lib/Doctrine/DBAL/Schema/Visitor/Graphviz.php
View file @
80f42dc7
...
@@ -41,11 +41,11 @@ class Graphviz extends AbstractVisitor
...
@@ -41,11 +41,11 @@ class Graphviz extends AbstractVisitor
$this
->
output
.=
$this
->
createNodeRelation
(
$this
->
output
.=
$this
->
createNodeRelation
(
$fkConstraint
->
getLocalTableName
()
.
":col"
.
current
(
$fkConstraint
->
getLocalColumns
())
.
":se"
,
$fkConstraint
->
getLocalTableName
()
.
":col"
.
current
(
$fkConstraint
->
getLocalColumns
())
.
":se"
,
$fkConstraint
->
getForeignTableName
()
.
":col"
.
current
(
$fkConstraint
->
getForeignColumns
())
.
":se"
,
$fkConstraint
->
getForeignTableName
()
.
":col"
.
current
(
$fkConstraint
->
getForeignColumns
())
.
":se"
,
array
(
[
'dir'
=>
'back'
,
'dir'
=>
'back'
,
'arrowtail'
=>
'dot'
,
'arrowtail'
=>
'dot'
,
'arrowhead'
=>
'normal'
,
'arrowhead'
=>
'normal'
,
)
]
);
);
}
}
...
@@ -69,10 +69,10 @@ class Graphviz extends AbstractVisitor
...
@@ -69,10 +69,10 @@ class Graphviz extends AbstractVisitor
{
{
$this
->
output
.=
$this
->
createNode
(
$this
->
output
.=
$this
->
createNode
(
$table
->
getName
(),
$table
->
getName
(),
array
(
[
'label'
=>
$this
->
createTableLabel
(
$table
),
'label'
=>
$this
->
createTableLabel
(
$table
),
'shape'
=>
'plaintext'
,
'shape'
=>
'plaintext'
,
)
]
);
);
}
}
...
...
lib/Doctrine/DBAL/Sharding/SQLAzure/SQLAzureFederationsSynchronizer.php
View file @
80f42dc7
...
@@ -183,10 +183,10 @@ class SQLAzureFederationsSynchronizer extends AbstractSchemaSynchronizer
...
@@ -183,10 +183,10 @@ class SQLAzureFederationsSynchronizer extends AbstractSchemaSynchronizer
*/
*/
private
function
partitionSchema
(
Schema
$schema
)
private
function
partitionSchema
(
Schema
$schema
)
{
{
return
array
(
return
[
$this
->
extractSchemaFederation
(
$schema
,
false
),
$this
->
extractSchemaFederation
(
$schema
,
false
),
$this
->
extractSchemaFederation
(
$schema
,
true
),
$this
->
extractSchemaFederation
(
$schema
,
true
),
)
;
]
;
}
}
/**
/**
...
...
lib/Doctrine/DBAL/Sharding/SQLAzure/Schema/MultiTenantVisitor.php
View file @
80f42dc7
...
@@ -53,7 +53,7 @@ class MultiTenantVisitor implements Visitor
...
@@ -53,7 +53,7 @@ class MultiTenantVisitor implements Visitor
/**
/**
* @var array
* @var array
*/
*/
private
$excludedTables
=
array
()
;
private
$excludedTables
=
[]
;
/**
/**
* @var string
* @var string
...
...
lib/Doctrine/DBAL/Statement.php
View file @
80f42dc7
...
@@ -44,14 +44,14 @@ class Statement implements \IteratorAggregate, DriverStatement
...
@@ -44,14 +44,14 @@ class Statement implements \IteratorAggregate, DriverStatement
*
*
* @var array
* @var array
*/
*/
protected
$params
=
array
()
;
protected
$params
=
[]
;
/**
/**
* The parameter types.
* The parameter types.
*
*
* @var array
* @var array
*/
*/
protected
$types
=
array
()
;
protected
$types
=
[]
;
/**
/**
* The underlying driver statement.
* The underlying driver statement.
...
@@ -181,8 +181,8 @@ class Statement implements \IteratorAggregate, DriverStatement
...
@@ -181,8 +181,8 @@ class Statement implements \IteratorAggregate, DriverStatement
if
(
$logger
)
{
if
(
$logger
)
{
$logger
->
stopQuery
();
$logger
->
stopQuery
();
}
}
$this
->
params
=
array
()
;
$this
->
params
=
[]
;
$this
->
types
=
array
()
;
$this
->
types
=
[]
;
return
$stmt
;
return
$stmt
;
}
}
...
...
lib/Doctrine/DBAL/Tools/Console/Command/ImportCommand.php
View file @
80f42dc7
...
@@ -45,11 +45,11 @@ class ImportCommand extends Command
...
@@ -45,11 +45,11 @@ class ImportCommand extends Command
$this
$this
->
setName
(
'dbal:import'
)
->
setName
(
'dbal:import'
)
->
setDescription
(
'Import SQL file(s) directly to Database.'
)
->
setDescription
(
'Import SQL file(s) directly to Database.'
)
->
setDefinition
(
array
(
->
setDefinition
(
[
new
InputArgument
(
new
InputArgument
(
'file'
,
InputArgument
::
REQUIRED
|
InputArgument
::
IS_ARRAY
,
'File path(s) of SQL to be executed.'
'file'
,
InputArgument
::
REQUIRED
|
InputArgument
::
IS_ARRAY
,
'File path(s) of SQL to be executed.'
)
)
)
)
]
)
->
setHelp
(
<<<EOT
->
setHelp
(
<<<EOT
Import SQL file(s) directly to Database.
Import SQL file(s) directly to Database.
EOT
EOT
...
...
lib/Doctrine/DBAL/Tools/Console/Command/ReservedWordsCommand.php
View file @
80f42dc7
...
@@ -30,7 +30,7 @@ class ReservedWordsCommand extends Command
...
@@ -30,7 +30,7 @@ class ReservedWordsCommand extends Command
/**
/**
* @var array
* @var array
*/
*/
private
$keywordListClasses
=
array
(
private
$keywordListClasses
=
[
'mysql'
=>
'Doctrine\DBAL\Platforms\Keywords\MySQLKeywords'
,
'mysql'
=>
'Doctrine\DBAL\Platforms\Keywords\MySQLKeywords'
,
'mysql57'
=>
'Doctrine\DBAL\Platforms\Keywords\MySQL57Keywords'
,
'mysql57'
=>
'Doctrine\DBAL\Platforms\Keywords\MySQL57Keywords'
,
'sqlserver'
=>
'Doctrine\DBAL\Platforms\Keywords\SQLServerKeywords'
,
'sqlserver'
=>
'Doctrine\DBAL\Platforms\Keywords\SQLServerKeywords'
,
...
@@ -47,7 +47,7 @@ class ReservedWordsCommand extends Command
...
@@ -47,7 +47,7 @@ class ReservedWordsCommand extends Command
'sqlanywhere11'
=>
'Doctrine\DBAL\Platforms\Keywords\SQLAnywhere11Keywords'
,
'sqlanywhere11'
=>
'Doctrine\DBAL\Platforms\Keywords\SQLAnywhere11Keywords'
,
'sqlanywhere12'
=>
'Doctrine\DBAL\Platforms\Keywords\SQLAnywhere12Keywords'
,
'sqlanywhere12'
=>
'Doctrine\DBAL\Platforms\Keywords\SQLAnywhere12Keywords'
,
'sqlanywhere16'
=>
'Doctrine\DBAL\Platforms\Keywords\SQLAnywhere16Keywords'
,
'sqlanywhere16'
=>
'Doctrine\DBAL\Platforms\Keywords\SQLAnywhere16Keywords'
,
)
;
]
;
/**
/**
* If you want to add or replace a keywords list use this command.
* If you want to add or replace a keywords list use this command.
...
@@ -120,7 +120,7 @@ EOT
...
@@ -120,7 +120,7 @@ EOT
$keywordLists
=
(
array
)
$input
->
getOption
(
'list'
);
$keywordLists
=
(
array
)
$input
->
getOption
(
'list'
);
if
(
!
$keywordLists
)
{
if
(
!
$keywordLists
)
{
$keywordLists
=
array
(
$keywordLists
=
[
'mysql'
,
'mysql'
,
'mysql57'
,
'mysql57'
,
'pgsql'
,
'pgsql'
,
...
@@ -135,7 +135,7 @@ EOT
...
@@ -135,7 +135,7 @@ EOT
'sqlanywhere11'
,
'sqlanywhere11'
,
'sqlanywhere12'
,
'sqlanywhere12'
,
'sqlanywhere16'
,
'sqlanywhere16'
,
)
;
]
;
}
}
$keywords
=
[];
$keywords
=
[];
...
...
lib/Doctrine/DBAL/Types/JsonArrayType.php
View file @
80f42dc7
...
@@ -36,7 +36,7 @@ class JsonArrayType extends JsonType
...
@@ -36,7 +36,7 @@ class JsonArrayType extends JsonType
public
function
convertToPHPValue
(
$value
,
AbstractPlatform
$platform
)
public
function
convertToPHPValue
(
$value
,
AbstractPlatform
$platform
)
{
{
if
(
$value
===
null
||
$value
===
''
)
{
if
(
$value
===
null
||
$value
===
''
)
{
return
array
()
;
return
[]
;
}
}
$value
=
(
is_resource
(
$value
))
?
stream_get_contents
(
$value
)
:
$value
;
$value
=
(
is_resource
(
$value
))
?
stream_get_contents
(
$value
)
:
$value
;
...
...
lib/Doctrine/DBAL/Types/SimpleArrayType.php
View file @
80f42dc7
...
@@ -57,7 +57,7 @@ class SimpleArrayType extends Type
...
@@ -57,7 +57,7 @@ class SimpleArrayType extends Type
public
function
convertToPHPValue
(
$value
,
AbstractPlatform
$platform
)
public
function
convertToPHPValue
(
$value
,
AbstractPlatform
$platform
)
{
{
if
(
$value
===
null
)
{
if
(
$value
===
null
)
{
return
array
()
;
return
[]
;
}
}
$value
=
(
is_resource
(
$value
))
?
stream_get_contents
(
$value
)
:
$value
;
$value
=
(
is_resource
(
$value
))
?
stream_get_contents
(
$value
)
:
$value
;
...
...
lib/Doctrine/DBAL/Types/Type.php
View file @
80f42dc7
...
@@ -64,14 +64,14 @@ abstract class Type
...
@@ -64,14 +64,14 @@ abstract class Type
*
*
* @var array
* @var array
*/
*/
private
static
$_typeObjects
=
array
()
;
private
static
$_typeObjects
=
[]
;
/**
/**
* The map of supported doctrine mapping types.
* The map of supported doctrine mapping types.
*
*
* @var array
* @var array
*/
*/
private
static
$_typesMap
=
array
(
private
static
$_typesMap
=
[
self
::
TARRAY
=>
ArrayType
::
class
,
self
::
TARRAY
=>
ArrayType
::
class
,
self
::
SIMPLE_ARRAY
=>
SimpleArrayType
::
class
,
self
::
SIMPLE_ARRAY
=>
SimpleArrayType
::
class
,
self
::
JSON_ARRAY
=>
JsonArrayType
::
class
,
self
::
JSON_ARRAY
=>
JsonArrayType
::
class
,
...
@@ -97,7 +97,7 @@ abstract class Type
...
@@ -97,7 +97,7 @@ abstract class Type
self
::
BLOB
=>
BlobType
::
class
,
self
::
BLOB
=>
BlobType
::
class
,
self
::
GUID
=>
GuidType
::
class
,
self
::
GUID
=>
GuidType
::
class
,
self
::
DATEINTERVAL
=>
DateIntervalType
::
class
,
self
::
DATEINTERVAL
=>
DateIntervalType
::
class
,
)
;
]
;
/**
/**
* Prevents instantiation and forces use of the factory method.
* Prevents instantiation and forces use of the factory method.
...
@@ -333,7 +333,7 @@ abstract class Type
...
@@ -333,7 +333,7 @@ abstract class Type
*/
*/
public
function
getMappedDatabaseTypes
(
AbstractPlatform
$platform
)
public
function
getMappedDatabaseTypes
(
AbstractPlatform
$platform
)
{
{
return
array
()
;
return
[]
;
}
}
/**
/**
...
...
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