Unverified Commit d4c2be87 authored by belgattitude's avatar belgattitude Committed by Luís Cobucci

csfix: There must be a single space before the colon on return types

parent 2dda57a9
...@@ -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);
} }
......
...@@ -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);
} }
......
...@@ -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',
......
...@@ -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;
} }
......
...@@ -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);
} }
......
...@@ -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) {
......
...@@ -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.');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment