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
d4c2be87
Unverified
Commit
d4c2be87
authored
Oct 11, 2017
by
belgattitude
Committed by
Luís Cobucci
Nov 19, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
csfix: There must be a single space before the colon on return types
parent
2dda57a9
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
25 additions
and
25 deletions
+25
-25
AbstractMySQLDriver.php
lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php
+6
-6
Driver.php
lib/Doctrine/DBAL/Driver/DrizzlePDOMySql/Driver.php
+3
-3
MariaDb102Keywords.php
lib/Doctrine/DBAL/Platforms/Keywords/MariaDb102Keywords.php
+2
-2
MariaDb102Platform.php
lib/Doctrine/DBAL/Platforms/MariaDb102Platform.php
+5
-5
MySqlPlatform.php
lib/Doctrine/DBAL/Platforms/MySqlPlatform.php
+1
-1
MySqlSchemaManager.php
lib/Doctrine/DBAL/Schema/MySqlSchemaManager.php
+1
-1
MySqlSchemaManagerTest.php
...e/Tests/DBAL/Functional/Schema/MySqlSchemaManagerTest.php
+7
-7
No files found.
lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php
View file @
d4c2be87
...
@@ -130,7 +130,7 @@ abstract class AbstractMySQLDriver implements Driver, ExceptionConverterDriver,
...
@@ -130,7 +130,7 @@ abstract class AbstractMySQLDriver implements Driver, ExceptionConverterDriver,
* @return AbstractPlatform|MariaDb102Platform|MySQL57Platform|MySqlPlatform
* @return AbstractPlatform|MariaDb102Platform|MySQL57Platform|MySqlPlatform
* @throws DBALException
* @throws DBALException
*/
*/
public
function
createDatabasePlatformForVersion
(
$version
)
:
AbstractPlatform
public
function
createDatabasePlatformForVersion
(
$version
)
:
AbstractPlatform
{
{
if
(
false
!==
stripos
(
$version
,
'mariadb'
))
{
if
(
false
!==
stripos
(
$version
,
'mariadb'
))
{
$versionNumber
=
$this
->
getMariaDbMysqlVersionNumber
(
$version
);
$versionNumber
=
$this
->
getMariaDbMysqlVersionNumber
(
$version
);
...
@@ -154,7 +154,7 @@ abstract class AbstractMySQLDriver implements Driver, ExceptionConverterDriver,
...
@@ -154,7 +154,7 @@ abstract class AbstractMySQLDriver implements Driver, ExceptionConverterDriver,
* @param string $versionString Version string returned by the driver, i.e. '5.7.10'
* @param string $versionString Version string returned by the driver, i.e. '5.7.10'
* @throws DBALException
* @throws DBALException
*/
*/
private
function
getOracleMysqlVersionNumber
(
string
$versionString
)
:
string
private
function
getOracleMysqlVersionNumber
(
string
$versionString
)
:
string
{
{
if
(
!
preg_match
(
'/^(?P<major>\d+)(?:\.(?P<minor>\d+)(?:\.(?P<patch>\d+))?)?/'
,
$versionString
,
$versionParts
))
{
if
(
!
preg_match
(
'/^(?P<major>\d+)(?:\.(?P<minor>\d+)(?:\.(?P<patch>\d+))?)?/'
,
$versionString
,
$versionParts
))
{
throw
DBALException
::
invalidPlatformVersionSpecified
(
throw
DBALException
::
invalidPlatformVersionSpecified
(
...
@@ -180,7 +180,7 @@ abstract class AbstractMySQLDriver implements Driver, ExceptionConverterDriver,
...
@@ -180,7 +180,7 @@ abstract class AbstractMySQLDriver implements Driver, ExceptionConverterDriver,
* @param string $versionString Version string as returned by mariadb server, i.e. '5.5.5-Mariadb-10.0.8-xenial'
* @param string $versionString Version string as returned by mariadb server, i.e. '5.5.5-Mariadb-10.0.8-xenial'
* @throws DBALException
* @throws DBALException
*/
*/
private
function
getMariaDbMysqlVersionNumber
(
string
$versionString
)
:
string
private
function
getMariaDbMysqlVersionNumber
(
string
$versionString
)
:
string
{
{
$version
=
str_replace
(
'5.5.5-'
,
''
,
$versionString
);
$version
=
str_replace
(
'5.5.5-'
,
''
,
$versionString
);
...
@@ -197,7 +197,7 @@ abstract class AbstractMySQLDriver implements Driver, ExceptionConverterDriver,
...
@@ -197,7 +197,7 @@ abstract class AbstractMySQLDriver implements Driver, ExceptionConverterDriver,
/**
/**
* {@inheritdoc}
* {@inheritdoc}
*/
*/
public
function
getDatabase
(
\Doctrine\DBAL\Connection
$conn
)
:
?
string
public
function
getDatabase
(
\Doctrine\DBAL\Connection
$conn
)
:
?
string
{
{
$params
=
$conn
->
getParams
();
$params
=
$conn
->
getParams
();
...
@@ -212,7 +212,7 @@ abstract class AbstractMySQLDriver implements Driver, ExceptionConverterDriver,
...
@@ -212,7 +212,7 @@ abstract class AbstractMySQLDriver implements Driver, ExceptionConverterDriver,
* {@inheritdoc}
* {@inheritdoc}
* @return MySqlPlatform
* @return MySqlPlatform
*/
*/
public
function
getDatabasePlatform
()
:
AbstractPlatform
public
function
getDatabasePlatform
()
:
AbstractPlatform
{
{
return
new
MySqlPlatform
();
return
new
MySqlPlatform
();
}
}
...
@@ -221,7 +221,7 @@ abstract class AbstractMySQLDriver implements Driver, ExceptionConverterDriver,
...
@@ -221,7 +221,7 @@ abstract class AbstractMySQLDriver implements Driver, ExceptionConverterDriver,
* {@inheritdoc}
* {@inheritdoc}
* @return MySqlSchemaManager
* @return MySqlSchemaManager
*/
*/
public
function
getSchemaManager
(
\Doctrine\DBAL\Connection
$conn
)
:
AbstractSchemaManager
public
function
getSchemaManager
(
\Doctrine\DBAL\Connection
$conn
)
:
AbstractSchemaManager
{
{
return
new
MySqlSchemaManager
(
$conn
);
return
new
MySqlSchemaManager
(
$conn
);
}
}
...
...
lib/Doctrine/DBAL/Driver/DrizzlePDOMySql/Driver.php
View file @
d4c2be87
...
@@ -49,7 +49,7 @@ class Driver extends \Doctrine\DBAL\Driver\PDOMySql\Driver
...
@@ -49,7 +49,7 @@ class Driver extends \Doctrine\DBAL\Driver\PDOMySql\Driver
/**
/**
* {@inheritdoc}
* {@inheritdoc}
*/
*/
public
function
createDatabasePlatformForVersion
(
$version
)
:
AbstractPlatform
public
function
createDatabasePlatformForVersion
(
$version
)
:
AbstractPlatform
{
{
return
$this
->
getDatabasePlatform
();
return
$this
->
getDatabasePlatform
();
}
}
...
@@ -57,7 +57,7 @@ class Driver extends \Doctrine\DBAL\Driver\PDOMySql\Driver
...
@@ -57,7 +57,7 @@ class Driver extends \Doctrine\DBAL\Driver\PDOMySql\Driver
/**
/**
* {@inheritdoc}
* {@inheritdoc}
*/
*/
public
function
getDatabasePlatform
()
:
AbstractPlatform
public
function
getDatabasePlatform
()
:
AbstractPlatform
{
{
return
new
DrizzlePlatform
();
return
new
DrizzlePlatform
();
}
}
...
@@ -65,7 +65,7 @@ class Driver extends \Doctrine\DBAL\Driver\PDOMySql\Driver
...
@@ -65,7 +65,7 @@ class Driver extends \Doctrine\DBAL\Driver\PDOMySql\Driver
/**
/**
* {@inheritdoc}
* {@inheritdoc}
*/
*/
public
function
getSchemaManager
(
\Doctrine\DBAL\Connection
$conn
)
:
AbstractSchemaManager
public
function
getSchemaManager
(
\Doctrine\DBAL\Connection
$conn
)
:
AbstractSchemaManager
{
{
return
new
DrizzleSchemaManager
(
$conn
);
return
new
DrizzleSchemaManager
(
$conn
);
}
}
...
...
lib/Doctrine/DBAL/Platforms/Keywords/MariaDb102Keywords.php
View file @
d4c2be87
...
@@ -28,7 +28,7 @@ final class MariaDb102Keywords extends MySQLKeywords
...
@@ -28,7 +28,7 @@ final class MariaDb102Keywords extends MySQLKeywords
/**
/**
* {@inheritdoc}
* {@inheritdoc}
*/
*/
public
function
getName
()
:
string
public
function
getName
()
:
string
{
{
return
'MariaDb102'
;
return
'MariaDb102'
;
}
}
...
@@ -36,7 +36,7 @@ final class MariaDb102Keywords extends MySQLKeywords
...
@@ -36,7 +36,7 @@ final class MariaDb102Keywords extends MySQLKeywords
/**
/**
* {@inheritdoc}
* {@inheritdoc}
*/
*/
protected
function
getKeywords
()
:
array
protected
function
getKeywords
()
:
array
{
{
return
[
return
[
'ACCESSIBLE'
,
'ACCESSIBLE'
,
...
...
lib/Doctrine/DBAL/Platforms/MariaDb102Platform.php
View file @
d4c2be87
...
@@ -34,7 +34,7 @@ final class MariaDb102Platform extends MySqlPlatform
...
@@ -34,7 +34,7 @@ final class MariaDb102Platform extends MySqlPlatform
/**
/**
* {@inheritdoc}
* {@inheritdoc}
*/
*/
public
function
hasNativeJsonType
()
:
bool
public
function
hasNativeJsonType
()
:
bool
{
{
return
true
;
return
true
;
}
}
...
@@ -43,7 +43,7 @@ final class MariaDb102Platform extends MySqlPlatform
...
@@ -43,7 +43,7 @@ final class MariaDb102Platform extends MySqlPlatform
* {@inheritdoc}
* {@inheritdoc}
* @link https://mariadb.com/kb/en/library/json-data-type/
* @link https://mariadb.com/kb/en/library/json-data-type/
*/
*/
public
function
getJsonTypeDeclarationSQL
(
array
$field
)
:
string
public
function
getJsonTypeDeclarationSQL
(
array
$field
)
:
string
{
{
return
'JSON'
;
return
'JSON'
;
}
}
...
@@ -51,7 +51,7 @@ final class MariaDb102Platform extends MySqlPlatform
...
@@ -51,7 +51,7 @@ final class MariaDb102Platform extends MySqlPlatform
/**
/**
* {@inheritdoc}
* {@inheritdoc}
*/
*/
protected
function
getReservedKeywordsClass
()
:
string
protected
function
getReservedKeywordsClass
()
:
string
{
{
return
Keywords\MariaDb102Keywords
::
class
;
return
Keywords\MariaDb102Keywords
::
class
;
}
}
...
@@ -59,7 +59,7 @@ final class MariaDb102Platform extends MySqlPlatform
...
@@ -59,7 +59,7 @@ final class MariaDb102Platform extends MySqlPlatform
/**
/**
* {@inheritdoc}
* {@inheritdoc}
*/
*/
protected
function
initializeDoctrineTypeMappings
()
:
void
protected
function
initializeDoctrineTypeMappings
()
:
void
{
{
parent
::
initializeDoctrineTypeMappings
();
parent
::
initializeDoctrineTypeMappings
();
...
@@ -72,7 +72,7 @@ final class MariaDb102Platform extends MySqlPlatform
...
@@ -72,7 +72,7 @@ final class MariaDb102Platform extends MySqlPlatform
* Since MariaDB 10.2.1 blob and text columns can have a default value.
* Since MariaDB 10.2.1 blob and text columns can have a default value.
* @link https://mariadb.com/kb/en/library/blob-and-text-data-types/
* @link https://mariadb.com/kb/en/library/blob-and-text-data-types/
*/
*/
protected
function
isDefaultValueSupportedForType
(
Type
$field
)
:
bool
protected
function
isDefaultValueSupportedForType
(
Type
$field
)
:
bool
{
{
return
true
;
return
true
;
}
}
...
...
lib/Doctrine/DBAL/Platforms/MySqlPlatform.php
View file @
d4c2be87
...
@@ -466,7 +466,7 @@ class MySqlPlatform extends AbstractPlatform
...
@@ -466,7 +466,7 @@ class MySqlPlatform extends AbstractPlatform
* MySQL (as of 5.7.19) does not support default values for Blob and Text
* MySQL (as of 5.7.19) does not support default values for Blob and Text
* columns while MariaDB 10.2.1 does.
* columns while MariaDB 10.2.1 does.
*/
*/
protected
function
isDefaultValueSupportedForType
(
Type
$field
)
:
bool
protected
function
isDefaultValueSupportedForType
(
Type
$field
)
:
bool
{
{
return
!
(
$field
instanceof
TextType
||
$field
instanceof
BlobType
);
return
!
(
$field
instanceof
TextType
||
$field
instanceof
BlobType
);
}
}
...
...
lib/Doctrine/DBAL/Schema/MySqlSchemaManager.php
View file @
d4c2be87
...
@@ -226,7 +226,7 @@ class MySqlSchemaManager extends AbstractSchemaManager
...
@@ -226,7 +226,7 @@ class MySqlSchemaManager extends AbstractSchemaManager
*
*
* @param null|string $columnDefault default value as stored in information_schema for MariaDB >= 10.2.7
* @param null|string $columnDefault default value as stored in information_schema for MariaDB >= 10.2.7
*/
*/
private
function
getMariaDb1027ColumnDefault
(
MariaDb102Platform
$platform
,
?
string
$columnDefault
)
:
?
string
{
private
function
getMariaDb1027ColumnDefault
(
MariaDb102Platform
$platform
,
?
string
$columnDefault
)
:
?
string
{
if
(
$columnDefault
===
'NULL'
||
$columnDefault
===
null
)
{
if
(
$columnDefault
===
'NULL'
||
$columnDefault
===
null
)
{
$defaultValue
=
null
;
$defaultValue
=
null
;
}
elseif
(
strpos
(
$columnDefault
,
"'"
)
===
0
)
{
}
elseif
(
strpos
(
$columnDefault
,
"'"
)
===
0
)
{
...
...
tests/Doctrine/Tests/DBAL/Functional/Schema/MySqlSchemaManagerTest.php
View file @
d4c2be87
...
@@ -341,7 +341,7 @@ class MySqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
...
@@ -341,7 +341,7 @@ class MySqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
* @link https://mariadb.com/kb/en/library/information-schema-columns-table/
* @link https://mariadb.com/kb/en/library/information-schema-columns-table/
* @link https://dev.mysql.com/doc/refman/5.5/en/string-literals.html
* @link https://dev.mysql.com/doc/refman/5.5/en/string-literals.html
*/
*/
public
function
testColumnDefaultValuesDoubleQuoted
()
:
void
public
function
testColumnDefaultValuesDoubleQuoted
()
:
void
{
{
$table
=
new
Table
(
"test_column_default_values_double_quoted"
);
$table
=
new
Table
(
"test_column_default_values_double_quoted"
);
$table
->
addColumn
(
'string_nullable_quoted'
,
'string'
,
[
'notnull'
=>
false
,
'default'
=>
'NULL'
]);
$table
->
addColumn
(
'string_nullable_quoted'
,
'string'
,
[
'notnull'
=>
false
,
'default'
=>
'NULL'
]);
...
@@ -369,7 +369,7 @@ class MySqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
...
@@ -369,7 +369,7 @@ class MySqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
* @link https://mariadb.com/kb/en/library/string-literals
* @link https://mariadb.com/kb/en/library/string-literals
* @link https://dev.mysql.com/doc/refman/5.7/en/string-literals.html
* @link https://dev.mysql.com/doc/refman/5.7/en/string-literals.html
*/
*/
public
function
testColumnEscapingDefaultValuesDoesNotTriggerSchemaChange
()
:
void
public
function
testColumnEscapingDefaultValuesDoesNotTriggerSchemaChange
()
:
void
{
{
$table
=
new
Table
(
"test_column_default_values_escaping"
);
$table
=
new
Table
(
"test_column_default_values_escaping"
);
$table
->
addColumn
(
'single_backslash'
,
'string'
,
[
'default'
=>
'F\Q\D\N'
]);
$table
->
addColumn
(
'single_backslash'
,
'string'
,
[
'default'
=>
'F\Q\D\N'
]);
...
@@ -395,7 +395,7 @@ class MySqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
...
@@ -395,7 +395,7 @@ class MySqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
self
::
assertFalse
(
$diff
,
"Tables should be identical with values escape sequences."
);
self
::
assertFalse
(
$diff
,
"Tables should be identical with values escape sequences."
);
}
}
public
function
testJsonColumnType
()
:
void
public
function
testJsonColumnType
()
:
void
{
{
$platform
=
$this
->
_sm
->
getDatabasePlatform
();
$platform
=
$this
->
_sm
->
getDatabasePlatform
();
if
(
!
$platform
->
hasNativeJsonType
())
{
if
(
!
$platform
->
hasNativeJsonType
())
{
...
@@ -417,7 +417,7 @@ class MySqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
...
@@ -417,7 +417,7 @@ class MySqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
* Note: MariaDb 10.2 silently change "\'" into "''" when storing in
* Note: MariaDb 10.2 silently change "\'" into "''" when storing in
* information schema, MariaDb102Platform should normalize the table details.
* information schema, MariaDb102Platform should normalize the table details.
*/
*/
public
function
testExistingTableWithQuotedDefaultsDoesNotTriggerChange
()
:
void
public
function
testExistingTableWithQuotedDefaultsDoesNotTriggerChange
()
:
void
{
{
$this
->
_conn
->
query
(
'DROP TABLE IF EXISTS test_column_defaults_with_create'
);
$this
->
_conn
->
query
(
'DROP TABLE IF EXISTS test_column_defaults_with_create'
);
$sql
=
"
$sql
=
"
...
@@ -441,7 +441,7 @@ class MySqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
...
@@ -441,7 +441,7 @@ class MySqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
self
::
assertFalse
(
$diff
);
self
::
assertFalse
(
$diff
);
}
}
public
function
testColumnDefaultCurrentTimestamp
()
:
void
public
function
testColumnDefaultCurrentTimestamp
()
:
void
{
{
$platform
=
$this
->
_sm
->
getDatabasePlatform
();
$platform
=
$this
->
_sm
->
getDatabasePlatform
();
...
@@ -507,7 +507,7 @@ class MySqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
...
@@ -507,7 +507,7 @@ class MySqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
* CURRENT_TIME as 'currtime()' and CURRENT_DATE as 'currdate()'.
* CURRENT_TIME as 'currtime()' and CURRENT_DATE as 'currdate()'.
* This test also ensure proper aliasing to not trigger a table diff.
* This test also ensure proper aliasing to not trigger a table diff.
*/
*/
public
function
testColumnDefaultValuesCurrentTimeAndDate
()
:
void
public
function
testColumnDefaultValuesCurrentTimeAndDate
()
:
void
{
{
if
(
!
$this
->
_sm
->
getDatabasePlatform
()
instanceof
MariaDb102Platform
)
{
if
(
!
$this
->
_sm
->
getDatabasePlatform
()
instanceof
MariaDb102Platform
)
{
$this
->
markTestSkipped
(
'Only relevant for MariaDb102Platform.'
);
$this
->
markTestSkipped
(
'Only relevant for MariaDb102Platform.'
);
...
@@ -544,7 +544,7 @@ class MySqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
...
@@ -544,7 +544,7 @@ class MySqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
*
*
* @link https://mariadb.com/kb/en/library/blob-and-text-data-types
* @link https://mariadb.com/kb/en/library/blob-and-text-data-types
*/
*/
public
function
testDoesPropagateDefaultValuesForBlobTextAndJson
()
:
void
public
function
testDoesPropagateDefaultValuesForBlobTextAndJson
()
:
void
{
{
if
(
!
$this
->
_sm
->
getDatabasePlatform
()
instanceof
MariaDb102Platform
)
{
if
(
!
$this
->
_sm
->
getDatabasePlatform
()
instanceof
MariaDb102Platform
)
{
$this
->
markTestSkipped
(
'Only relevant for MariaDb102Platform.'
);
$this
->
markTestSkipped
(
'Only relevant for MariaDb102Platform.'
);
...
...
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