@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | $table->setPrimaryKey(array('id')); |
| 23 | 23 | |
| 24 | 24 | $this->_conn->getSchemaManager()->createTable($table); |
| 25 | - } catch(\Exception $e) { |
|
| 25 | + } catch (\Exception $e) { |
|
| 26 | 26 | |
| 27 | 27 | } |
| 28 | 28 | $this->_conn->executeUpdate('DELETE FROM write_table'); |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | $sequence = new \Doctrine\DBAL\Schema\Sequence('write_table_id_seq'); |
| 162 | 162 | try { |
| 163 | 163 | $this->_conn->getSchemaManager()->createSequence($sequence); |
| 164 | - } catch(\Exception $e) { |
|
| 164 | + } catch (\Exception $e) { |
|
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | $sequences = $this->_conn->getSchemaManager()->listSequences(); |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | $this->markTestSkipped("Test only works consistently on platforms that support sequences and don't support identity columns."); |
| 185 | 185 | } |
| 186 | 186 | |
| 187 | - self::assertFalse($this->_conn->lastInsertId( null )); |
|
| 187 | + self::assertFalse($this->_conn->lastInsertId(null)); |
|
| 188 | 188 | |
| 189 | 189 | } |
| 190 | 190 | |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | { |
| 257 | 257 | $platform = $this->_conn->getDatabasePlatform(); |
| 258 | 258 | |
| 259 | - if ( ! ($platform->supportsIdentityColumns() || $platform->usesSequenceEmulatedIdentityColumns()) ) { |
|
| 259 | + if ( ! ($platform->supportsIdentityColumns() || $platform->usesSequenceEmulatedIdentityColumns())) { |
|
| 260 | 260 | $this->markTestSkipped( |
| 261 | 261 | 'Test only works on platforms with identity columns or sequence emulated identity columns.' |
| 262 | 262 | ); |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | |
| 269 | 269 | try { |
| 270 | 270 | $this->_conn->getSchemaManager()->dropTable($table->getQuotedName($platform)); |
| 271 | - } catch(\Exception $e) { } |
|
| 271 | + } catch (\Exception $e) { } |
|
| 272 | 272 | |
| 273 | 273 | foreach ($platform->getCreateTableSQL($table) as $sql) { |
| 274 | 274 | $this->_conn->exec($sql); |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | { |
| 20 | 20 | parent::setUp(); |
| 21 | 21 | |
| 22 | - if ( !($this->_conn->getDriver() instanceof ExceptionConverterDriver)) { |
|
| 22 | + if ( ! ($this->_conn->getDriver() instanceof ExceptionConverterDriver)) { |
|
| 23 | 23 | $this->markTestSkipped('Driver does not support special exception handling.'); |
| 24 | 24 | } |
| 25 | 25 | } |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | { |
| 165 | 165 | $platform = $this->_conn->getDatabasePlatform(); |
| 166 | 166 | |
| 167 | - if (!$platform->supportsForeignKeyConstraints()) { |
|
| 167 | + if ( ! $platform->supportsForeignKeyConstraints()) { |
|
| 168 | 168 | $this->markTestSkipped("Only fails on platforms with foreign key constraints."); |
| 169 | 169 | } |
| 170 | 170 | |
@@ -286,7 +286,7 @@ discard block |
||
| 286 | 286 | $this->markTestSkipped("Only fails this way on sqlite"); |
| 287 | 287 | } |
| 288 | 288 | |
| 289 | - $filename = sprintf('%s/%s', sys_get_temp_dir(), 'doctrine_failed_connection_'.$mode.'.db'); |
|
| 289 | + $filename = sprintf('%s/%s', sys_get_temp_dir(), 'doctrine_failed_connection_' . $mode . '.db'); |
|
| 290 | 290 | |
| 291 | 291 | if (file_exists($filename)) { |
| 292 | 292 | chmod($filename, 0200); // make the file writable again, so it can be removed on Windows |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | parent::setUp(); |
| 15 | 15 | |
| 16 | 16 | $platform = $this->_conn->getDatabasePlatform()->getName(); |
| 17 | - if (!in_array($platform, array('mysql', 'sqlite'))) { |
|
| 17 | + if ( ! in_array($platform, array('mysql', 'sqlite'))) { |
|
| 18 | 18 | $this->markTestSkipped('Currently restricted to MySQL and SQLite.'); |
| 19 | 19 | } |
| 20 | 20 | } |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | |
| 24 | 24 | $platform = $this->_conn->getDatabasePlatform()->getName(); |
| 25 | 25 | |
| 26 | - if (!in_array($platform, array('postgresql'))) { |
|
| 26 | + if ( ! in_array($platform, array('postgresql'))) { |
|
| 27 | 27 | $this->markTestSkipped('Currently restricted to PostgreSQL'); |
| 28 | 28 | } |
| 29 | 29 | |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | |
| 15 | 15 | $platform = $this->_conn->getDatabasePlatform()->getName(); |
| 16 | 16 | |
| 17 | - if (!in_array($platform, array('sqlite'))) { |
|
| 17 | + if ( ! in_array($platform, array('sqlite'))) { |
|
| 18 | 18 | $this->markTestSkipped('Related to SQLite only'); |
| 19 | 19 | } |
| 20 | 20 | } |
@@ -14,13 +14,13 @@ |
||
| 14 | 14 | { |
| 15 | 15 | parent::setUp(); |
| 16 | 16 | |
| 17 | - if(!isset($GLOBALS['db_username'])) { |
|
| 17 | + if ( ! isset($GLOBALS['db_username'])) { |
|
| 18 | 18 | $this->markTestSkipped('Foo'); |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | $username = $GLOBALS['db_username']; |
| 22 | 22 | |
| 23 | - $query = "GRANT ALL PRIVILEGES TO ".$username; |
|
| 23 | + $query = "GRANT ALL PRIVILEGES TO " . $username; |
|
| 24 | 24 | |
| 25 | 25 | $conn = \Doctrine\Tests\TestUtil::getTempConnection(); |
| 26 | 26 | $conn->executeUpdate($query); |
@@ -456,17 +456,17 @@ |
||
| 456 | 456 | $this->_conn->query('DROP TABLE IF EXISTS test_column_defaults_with_create'); |
| 457 | 457 | |
| 458 | 458 | $escapeSequences = [ |
| 459 | - "\\0", // An ASCII NUL (X'00') character |
|
| 460 | - "\\'", "''", // Single quote |
|
| 461 | - '\\"', '""', // Double quote |
|
| 462 | - '\\b', // A backspace character |
|
| 463 | - '\\n', // A new-line character |
|
| 464 | - '\\r', // A carriage return character |
|
| 465 | - '\\t', // A tab character |
|
| 466 | - '\\Z', // ASCII 26 (Control+Z) |
|
| 467 | - '\\\\', // A backslash (\) character |
|
| 468 | - '\\%', // A percent (%) character |
|
| 469 | - '\\_', // An underscore (_) character |
|
| 459 | + "\\0", // An ASCII NUL (X'00') character |
|
| 460 | + "\\'", "''", // Single quote |
|
| 461 | + '\\"', '""', // Double quote |
|
| 462 | + '\\b', // A backspace character |
|
| 463 | + '\\n', // A new-line character |
|
| 464 | + '\\r', // A carriage return character |
|
| 465 | + '\\t', // A tab character |
|
| 466 | + '\\Z', // ASCII 26 (Control+Z) |
|
| 467 | + '\\\\', // A backslash (\) character |
|
| 468 | + '\\%', // A percent (%) character |
|
| 469 | + '\\_', // An underscore (_) character |
|
| 470 | 470 | ]; |
| 471 | 471 | |
| 472 | 472 | $default = implode('+', $escapeSequences); |
@@ -159,7 +159,7 @@ |
||
| 159 | 159 | |
| 160 | 160 | $tableIndexes = $this->_sm->listTableIndexes('non_default_pk_order'); |
| 161 | 161 | |
| 162 | - self::assertCount(1, $tableIndexes); |
|
| 162 | + self::assertCount(1, $tableIndexes); |
|
| 163 | 163 | |
| 164 | 164 | self::assertArrayHasKey('primary', $tableIndexes, 'listTableIndexes() has to return a "primary" array key.'); |
| 165 | 165 | self::assertEquals(array('other_id', 'id'), array_map('strtolower', $tableIndexes['primary']->getColumns())); |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | |
| 24 | 24 | public function testCreateAndDropDatabase() |
| 25 | 25 | { |
| 26 | - $path = dirname(__FILE__).'/test_create_and_drop_sqlite_database.sqlite'; |
|
| 26 | + $path = dirname(__FILE__) . '/test_create_and_drop_sqlite_database.sqlite'; |
|
| 27 | 27 | |
| 28 | 28 | $this->_sm->createDatabase($path); |
| 29 | 29 | self::assertFileExists($path); |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | $version = \SQLite3::version(); |
| 148 | - if(version_compare($version['versionString'], '3.7.16', '<')) { |
|
| 148 | + if (version_compare($version['versionString'], '3.7.16', '<')) { |
|
| 149 | 149 | $this->markTestSkipped('This version of sqlite doesn\'t return the order of the Primary Key.'); |
| 150 | 150 | } |
| 151 | 151 | $this->_conn->exec(<<<EOS |
@@ -229,7 +229,7 @@ |
||
| 229 | 229 | for($i = 0; $i < count($fkOptions); $i++) { |
| 230 | 230 | $fkTable->addColumn("foreign_key_test$i", 'integer'); |
| 231 | 231 | $foreignKeys[] = new \Doctrine\DBAL\Schema\ForeignKeyConstraint( |
| 232 | - array("foreign_key_test$i"), 'test_create_fk2', array('id'), "foreign_key_test_$i"."_fk", array('onDelete' => $fkOptions[$i])); |
|
| 232 | + array("foreign_key_test$i"), 'test_create_fk2', array('id'), "foreign_key_test_$i"."_fk", array('onDelete' => $fkOptions[$i])); |
|
| 233 | 233 | } |
| 234 | 234 | $this->_sm->dropAndCreateTable($fkTable); |
| 235 | 235 | $this->createTestTable('test_create_fk2'); |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | { |
| 21 | 21 | parent::tearDown(); |
| 22 | 22 | |
| 23 | - if (!$this->_conn) { |
|
| 23 | + if ( ! $this->_conn) { |
|
| 24 | 24 | return; |
| 25 | 25 | } |
| 26 | 26 | |
@@ -219,22 +219,22 @@ discard block |
||
| 219 | 219 | |
| 220 | 220 | public function testListForeignKeys() |
| 221 | 221 | { |
| 222 | - if(!$this->_conn->getDatabasePlatform()->supportsForeignKeyConstraints()) { |
|
| 222 | + if ( ! $this->_conn->getDatabasePlatform()->supportsForeignKeyConstraints()) { |
|
| 223 | 223 | $this->markTestSkipped('Does not support foreign key constraints.'); |
| 224 | 224 | } |
| 225 | 225 | |
| 226 | - $fkOptions = array('SET NULL', 'SET DEFAULT', 'NO ACTION','CASCADE', 'RESTRICT'); |
|
| 226 | + $fkOptions = array('SET NULL', 'SET DEFAULT', 'NO ACTION', 'CASCADE', 'RESTRICT'); |
|
| 227 | 227 | $foreignKeys = array(); |
| 228 | 228 | $fkTable = $this->getTestTable('test_create_fk1'); |
| 229 | - for($i = 0; $i < count($fkOptions); $i++) { |
|
| 229 | + for ($i = 0; $i < count($fkOptions); $i++) { |
|
| 230 | 230 | $fkTable->addColumn("foreign_key_test$i", 'integer'); |
| 231 | 231 | $foreignKeys[] = new \Doctrine\DBAL\Schema\ForeignKeyConstraint( |
| 232 | - array("foreign_key_test$i"), 'test_create_fk2', array('id'), "foreign_key_test_$i"."_fk", array('onDelete' => $fkOptions[$i])); |
|
| 232 | + array("foreign_key_test$i"), 'test_create_fk2', array('id'), "foreign_key_test_$i" . "_fk", array('onDelete' => $fkOptions[$i])); |
|
| 233 | 233 | } |
| 234 | 234 | $this->_sm->dropAndCreateTable($fkTable); |
| 235 | 235 | $this->createTestTable('test_create_fk2'); |
| 236 | 236 | |
| 237 | - foreach($foreignKeys as $foreignKey) { |
|
| 237 | + foreach ($foreignKeys as $foreignKey) { |
|
| 238 | 238 | $this->_sm->createForeignKey($foreignKey, 'test_create_fk1'); |
| 239 | 239 | } |
| 240 | 240 | $fkeys = $this->_sm->listTableForeignKeys('test_create_fk1'); |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | self::assertEquals(array('id'), array_map('strtolower', $fkeys[$i]->getForeignColumns())); |
| 245 | 245 | self::assertEquals('test_create_fk2', strtolower($fkeys[0]->getForeignTableName())); |
| 246 | 246 | if ($foreignKeys[$i]->getOption('onDelete') == 'NO ACTION') { |
| 247 | - self::assertFalse($fkeys[$i]->hasOption('onDelete'), 'Unexpected option: '. $fkeys[$i]->getOption('onDelete')); |
|
| 247 | + self::assertFalse($fkeys[$i]->hasOption('onDelete'), 'Unexpected option: ' . $fkeys[$i]->getOption('onDelete')); |
|
| 248 | 248 | } else { |
| 249 | 249 | self::assertEquals($foreignKeys[$i]->getOption('onDelete'), $fkeys[$i]->getOption('onDelete')); |
| 250 | 250 | } |
@@ -378,7 +378,7 @@ discard block |
||
| 378 | 378 | */ |
| 379 | 379 | public function testJsonbColumn(string $type): void |
| 380 | 380 | { |
| 381 | - if (!$this->_sm->getDatabasePlatform() instanceof PostgreSQL94Platform) { |
|
| 381 | + if ( ! $this->_sm->getDatabasePlatform() instanceof PostgreSQL94Platform) { |
|
| 382 | 382 | $this->markTestSkipped("Requires PostgresSQL 9.4+"); |
| 383 | 383 | return; |
| 384 | 384 | } |