From ec04c4d8a52835fccd4387a4d480f613c097b183 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Mon, 11 Sep 2017 20:21:45 +0200 Subject: [PATCH 1/2] Remove unused use statements --- lib/Doctrine/DBAL/Types/PhpDateTimeMappingType.php | 2 -- lib/Doctrine/DBAL/Types/PhpIntegerMappingType.php | 2 -- 2 files changed, 4 deletions(-) diff --git a/lib/Doctrine/DBAL/Types/PhpDateTimeMappingType.php b/lib/Doctrine/DBAL/Types/PhpDateTimeMappingType.php index 353b9c673f6..d530d8cf074 100644 --- a/lib/Doctrine/DBAL/Types/PhpDateTimeMappingType.php +++ b/lib/Doctrine/DBAL/Types/PhpDateTimeMappingType.php @@ -19,8 +19,6 @@ namespace Doctrine\DBAL\Types; -use Doctrine\DBAL\Platforms\AbstractPlatform; - /** * Implementations should map a database type to a PHP DateTimeInterface instance. * @internal diff --git a/lib/Doctrine/DBAL/Types/PhpIntegerMappingType.php b/lib/Doctrine/DBAL/Types/PhpIntegerMappingType.php index c8a020cc1b9..034aaecb33a 100644 --- a/lib/Doctrine/DBAL/Types/PhpIntegerMappingType.php +++ b/lib/Doctrine/DBAL/Types/PhpIntegerMappingType.php @@ -19,8 +19,6 @@ namespace Doctrine\DBAL\Types; -use Doctrine\DBAL\Platforms\AbstractPlatform; - /** * Implementations should map a database type to a PHP integer. * @internal From e63cd3d74686e6e34a83e6fc26609a92e8166e25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Mon, 11 Sep 2017 20:22:17 +0200 Subject: [PATCH 2/2] Abide by the new coding style --- .../Tests/DBAL/Platforms/AbstractPlatformTestCase.php | 10 +++++----- .../Tests/DBAL/Platforms/SQLServer2008PlatformTest.php | 10 +++++----- .../Tests/DBAL/Platforms/SQLServer2012PlatformTest.php | 10 +++++----- .../Tests/DBAL/Platforms/SQLServerPlatformTest.php | 10 +++++----- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/tests/Doctrine/Tests/DBAL/Platforms/AbstractPlatformTestCase.php b/tests/Doctrine/Tests/DBAL/Platforms/AbstractPlatformTestCase.php index 7942d213e07..d16fb966754 100644 --- a/tests/Doctrine/Tests/DBAL/Platforms/AbstractPlatformTestCase.php +++ b/tests/Doctrine/Tests/DBAL/Platforms/AbstractPlatformTestCase.php @@ -563,16 +563,16 @@ public function testGetDefaultValueDeclarationSQLForIntegerTypes() } } - public function testGetDefaultValueDeclarationSQLForDateType() + public function testGetDefaultValueDeclarationSQLForDateType() : void { $currentDateSql = $this->_platform->getCurrentDateSQL(); - $field = array( + $field = [ 'type' => Type::getType('date'), 'default' => $currentDateSql, - ); + ]; - $this->assertEquals( - ' DEFAULT '.$currentDateSql, + self::assertSame( + ' DEFAULT ' . $currentDateSql, $this->_platform->getDefaultValueDeclarationSQL($field) ); } diff --git a/tests/Doctrine/Tests/DBAL/Platforms/SQLServer2008PlatformTest.php b/tests/Doctrine/Tests/DBAL/Platforms/SQLServer2008PlatformTest.php index ed8a615c6d6..718602e38da 100644 --- a/tests/Doctrine/Tests/DBAL/Platforms/SQLServer2008PlatformTest.php +++ b/tests/Doctrine/Tests/DBAL/Platforms/SQLServer2008PlatformTest.php @@ -21,16 +21,16 @@ public function testGeneratesTypeDeclarationForDateTimeTz() ); } - public function testGetDefaultValueDeclarationSQLForDateType() + public function testGetDefaultValueDeclarationSQLForDateType() : void { $currentDateSql = $this->_platform->getCurrentDateSQL(); - $field = array( + $field = [ 'type' => Type::getType('date'), 'default' => $currentDateSql, - ); + ]; - $this->assertEquals( - " DEFAULT '".$currentDateSql."'", + self::assertSame( + " DEFAULT '" . $currentDateSql . "'", $this->_platform->getDefaultValueDeclarationSQL($field) ); } diff --git a/tests/Doctrine/Tests/DBAL/Platforms/SQLServer2012PlatformTest.php b/tests/Doctrine/Tests/DBAL/Platforms/SQLServer2012PlatformTest.php index 61efbe8f30d..3c69ac3b181 100644 --- a/tests/Doctrine/Tests/DBAL/Platforms/SQLServer2012PlatformTest.php +++ b/tests/Doctrine/Tests/DBAL/Platforms/SQLServer2012PlatformTest.php @@ -373,16 +373,16 @@ public function testModifyLimitQueryWithNewlineBeforeOrderBy() self::assertEquals($expectedSql, $sql); } - public function testGetDefaultValueDeclarationSQLForDateType() + public function testGetDefaultValueDeclarationSQLForDateType() : void { $currentDateSql = $this->_platform->getCurrentDateSQL(); - $field = array( + $field = [ 'type' => Type::getType('date'), 'default' => $currentDateSql, - ); + ]; - $this->assertEquals( - " DEFAULT '".$currentDateSql."'", + self::assertSame( + " DEFAULT '" . $currentDateSql . "'", $this->_platform->getDefaultValueDeclarationSQL($field) ); } diff --git a/tests/Doctrine/Tests/DBAL/Platforms/SQLServerPlatformTest.php b/tests/Doctrine/Tests/DBAL/Platforms/SQLServerPlatformTest.php index dffb18b0977..c0309b9fb9f 100644 --- a/tests/Doctrine/Tests/DBAL/Platforms/SQLServerPlatformTest.php +++ b/tests/Doctrine/Tests/DBAL/Platforms/SQLServerPlatformTest.php @@ -59,16 +59,16 @@ public function getModifyLimitQueries() ); } - public function testGetDefaultValueDeclarationSQLForDateType() + public function testGetDefaultValueDeclarationSQLForDateType() : void { $currentDateSql = $this->_platform->getCurrentDateSQL(); - $field = array( + $field = [ 'type' => Type::getType('date'), 'default' => $currentDateSql, - ); + ]; - $this->assertEquals( - " DEFAULT '".$currentDateSql."'", + self::assertSame( + " DEFAULT '" . $currentDateSql . "'", $this->_platform->getDefaultValueDeclarationSQL($field) ); }