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,
* @return AbstractPlatform|MariaDb102Platform|MySQL57Platform|MySqlPlatform
* @throws DBALException
*/
public function createDatabasePlatformForVersion($version): AbstractPlatform
public function createDatabasePlatformForVersion($version) : AbstractPlatform
{
if (false !== stripos($version, 'mariadb')) {
$versionNumber = $this->getMariaDbMysqlVersionNumber($version);
......@@ -154,7 +154,7 @@ abstract class AbstractMySQLDriver implements Driver, ExceptionConverterDriver,
* @param string $versionString Version string returned by the driver, i.e. '5.7.10'
* @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)) {
throw DBALException::invalidPlatformVersionSpecified(
......@@ -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'
* @throws DBALException
*/
private function getMariaDbMysqlVersionNumber(string $versionString): string
private function getMariaDbMysqlVersionNumber(string $versionString) : string
{
$version = str_replace('5.5.5-', '', $versionString);
......@@ -197,7 +197,7 @@ abstract class AbstractMySQLDriver implements Driver, ExceptionConverterDriver,
/**
* {@inheritdoc}
*/
public function getDatabase(\Doctrine\DBAL\Connection $conn): ?string
public function getDatabase(\Doctrine\DBAL\Connection $conn) : ?string
{
$params = $conn->getParams();
......@@ -212,7 +212,7 @@ abstract class AbstractMySQLDriver implements Driver, ExceptionConverterDriver,
* {@inheritdoc}
* @return MySqlPlatform
*/
public function getDatabasePlatform(): AbstractPlatform
public function getDatabasePlatform() : AbstractPlatform
{
return new MySqlPlatform();
}
......@@ -221,7 +221,7 @@ abstract class AbstractMySQLDriver implements Driver, ExceptionConverterDriver,
* {@inheritdoc}
* @return MySqlSchemaManager
*/
public function getSchemaManager(\Doctrine\DBAL\Connection $conn): AbstractSchemaManager
public function getSchemaManager(\Doctrine\DBAL\Connection $conn) : AbstractSchemaManager
{
return new MySqlSchemaManager($conn);
}
......
......@@ -49,7 +49,7 @@ class Driver extends \Doctrine\DBAL\Driver\PDOMySql\Driver
/**
* {@inheritdoc}
*/
public function createDatabasePlatformForVersion($version): AbstractPlatform
public function createDatabasePlatformForVersion($version) : AbstractPlatform
{
return $this->getDatabasePlatform();
}
......@@ -57,7 +57,7 @@ class Driver extends \Doctrine\DBAL\Driver\PDOMySql\Driver
/**
* {@inheritdoc}
*/
public function getDatabasePlatform(): AbstractPlatform
public function getDatabasePlatform() : AbstractPlatform
{
return new DrizzlePlatform();
}
......@@ -65,7 +65,7 @@ class Driver extends \Doctrine\DBAL\Driver\PDOMySql\Driver
/**
* {@inheritdoc}
*/
public function getSchemaManager(\Doctrine\DBAL\Connection $conn): AbstractSchemaManager
public function getSchemaManager(\Doctrine\DBAL\Connection $conn) : AbstractSchemaManager
{
return new DrizzleSchemaManager($conn);
}
......
......@@ -28,7 +28,7 @@ final class MariaDb102Keywords extends MySQLKeywords
/**
* {@inheritdoc}
*/
public function getName(): string
public function getName() : string
{
return 'MariaDb102';
}
......@@ -36,7 +36,7 @@ final class MariaDb102Keywords extends MySQLKeywords
/**
* {@inheritdoc}
*/
protected function getKeywords(): array
protected function getKeywords() : array
{
return [
'ACCESSIBLE',
......
......@@ -34,7 +34,7 @@ final class MariaDb102Platform extends MySqlPlatform
/**
* {@inheritdoc}
*/
public function hasNativeJsonType(): bool
public function hasNativeJsonType() : bool
{
return true;
}
......@@ -43,7 +43,7 @@ final class MariaDb102Platform extends MySqlPlatform
* {@inheritdoc}
* @link https://mariadb.com/kb/en/library/json-data-type/
*/
public function getJsonTypeDeclarationSQL(array $field): string
public function getJsonTypeDeclarationSQL(array $field) : string
{
return 'JSON';
}
......@@ -51,7 +51,7 @@ final class MariaDb102Platform extends MySqlPlatform
/**
* {@inheritdoc}
*/
protected function getReservedKeywordsClass(): string
protected function getReservedKeywordsClass() : string
{
return Keywords\MariaDb102Keywords::class;
}
......@@ -59,7 +59,7 @@ final class MariaDb102Platform extends MySqlPlatform
/**
* {@inheritdoc}
*/
protected function initializeDoctrineTypeMappings(): void
protected function initializeDoctrineTypeMappings() : void
{
parent::initializeDoctrineTypeMappings();
......@@ -72,7 +72,7 @@ final class MariaDb102Platform extends MySqlPlatform
* 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/
*/
protected function isDefaultValueSupportedForType(Type $field): bool
protected function isDefaultValueSupportedForType(Type $field) : bool
{
return true;
}
......
......@@ -466,7 +466,7 @@ class MySqlPlatform extends AbstractPlatform
* MySQL (as of 5.7.19) does not support default values for Blob and Text
* 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);
}
......
......@@ -226,7 +226,7 @@ class MySqlSchemaManager extends AbstractSchemaManager
*
* @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) {
$defaultValue = null;
} elseif (strpos($columnDefault, "'") === 0) {
......
......@@ -341,7 +341,7 @@ class MySqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
* @link https://mariadb.com/kb/en/library/information-schema-columns-table/
* @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->addColumn('string_nullable_quoted', 'string', ['notnull' => false, 'default' => 'NULL']);
......@@ -369,7 +369,7 @@ class MySqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
* @link https://mariadb.com/kb/en/library/string-literals
* @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->addColumn('single_backslash', 'string', ['default' => 'F\Q\D\N']);
......@@ -395,7 +395,7 @@ class MySqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
self::assertFalse($diff, "Tables should be identical with values escape sequences.");
}
public function testJsonColumnType(): void
public function testJsonColumnType() : void
{
$platform = $this->_sm->getDatabasePlatform();
if (!$platform->hasNativeJsonType()) {
......@@ -417,7 +417,7 @@ class MySqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
* Note: MariaDb 10.2 silently change "\'" into "''" when storing in
* 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');
$sql = "
......@@ -441,7 +441,7 @@ class MySqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
self::assertFalse($diff);
}
public function testColumnDefaultCurrentTimestamp(): void
public function testColumnDefaultCurrentTimestamp() : void
{
$platform = $this->_sm->getDatabasePlatform();
......@@ -507,7 +507,7 @@ class MySqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
* CURRENT_TIME as 'currtime()' and CURRENT_DATE as 'currdate()'.
* 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) {
$this->markTestSkipped('Only relevant for MariaDb102Platform.');
......@@ -544,7 +544,7 @@ class MySqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
*
* @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) {
$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