Unverified Commit 0ee865a0 authored by Marco Pivetta's avatar Marco Pivetta Committed by GitHub

Merge pull request #3364 from BenMorel/develop_cleanup

Clean up redundant annotations and dead code in tests
parents f82e84bc 65ba00f4
...@@ -1550,8 +1550,6 @@ abstract class AbstractPlatform ...@@ -1550,8 +1550,6 @@ abstract class AbstractPlatform
$columns = []; $columns = [];
foreach ($table->getColumns() as $column) { foreach ($table->getColumns() as $column) {
/** @var Column $column */
if ($this->_eventManager !== null && $this->_eventManager->hasListeners(Events::onSchemaCreateTableColumn)) { if ($this->_eventManager !== null && $this->_eventManager->hasListeners(Events::onSchemaCreateTableColumn)) {
$eventArgs = new SchemaCreateTableColumnEventArgs($column, $table, $this); $eventArgs = new SchemaCreateTableColumnEventArgs($column, $table, $this);
$this->_eventManager->dispatchEvent(Events::onSchemaCreateTableColumn, $eventArgs); $this->_eventManager->dispatchEvent(Events::onSchemaCreateTableColumn, $eventArgs);
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
namespace Doctrine\DBAL\Platforms; namespace Doctrine\DBAL\Platforms;
use Doctrine\DBAL\Schema\ColumnDiff;
use Doctrine\DBAL\Schema\Identifier; use Doctrine\DBAL\Schema\Identifier;
use Doctrine\DBAL\Schema\Index; use Doctrine\DBAL\Schema\Index;
use Doctrine\DBAL\Schema\Table; use Doctrine\DBAL\Schema\Table;
...@@ -508,7 +507,6 @@ class DrizzlePlatform extends AbstractPlatform ...@@ -508,7 +507,6 @@ class DrizzlePlatform extends AbstractPlatform
continue; continue;
} }
/** @var ColumnDiff $columnDiff */
$column = $columnDiff->column; $column = $columnDiff->column;
$columnArray = $column->toArray(); $columnArray = $column->toArray();
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
namespace Doctrine\DBAL\Platforms; namespace Doctrine\DBAL\Platforms;
use Doctrine\DBAL\Schema\ColumnDiff;
use Doctrine\DBAL\Schema\ForeignKeyConstraint; use Doctrine\DBAL\Schema\ForeignKeyConstraint;
use Doctrine\DBAL\Schema\Identifier; use Doctrine\DBAL\Schema\Identifier;
use Doctrine\DBAL\Schema\Index; use Doctrine\DBAL\Schema\Index;
...@@ -580,7 +579,6 @@ SQL ...@@ -580,7 +579,6 @@ SQL
continue; continue;
} }
/** @var ColumnDiff $columnDiff */
$column = $columnDiff->column; $column = $columnDiff->column;
$columnArray = $column->toArray(); $columnArray = $column->toArray();
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
namespace Doctrine\DBAL\Platforms; namespace Doctrine\DBAL\Platforms;
use Doctrine\DBAL\DBALException; use Doctrine\DBAL\DBALException;
use Doctrine\DBAL\Schema\ColumnDiff;
use Doctrine\DBAL\Schema\ForeignKeyConstraint; use Doctrine\DBAL\Schema\ForeignKeyConstraint;
use Doctrine\DBAL\Schema\Identifier; use Doctrine\DBAL\Schema\Identifier;
use Doctrine\DBAL\Schema\Index; use Doctrine\DBAL\Schema\Index;
...@@ -799,7 +798,6 @@ SQL ...@@ -799,7 +798,6 @@ SQL
continue; continue;
} }
/** @var ColumnDiff $columnDiff */
$column = $columnDiff->column; $column = $columnDiff->column;
// Do not generate column alteration clause if type is binary and only fixed property has changed. // Do not generate column alteration clause if type is binary and only fixed property has changed.
......
...@@ -116,7 +116,6 @@ class SQLAnywherePlatform extends AbstractPlatform ...@@ -116,7 +116,6 @@ class SQLAnywherePlatform extends AbstractPlatform
$tableSql = []; $tableSql = [];
$alterClauses = []; $alterClauses = [];
/** @var Column $column */
foreach ($diff->addedColumns as $column) { foreach ($diff->addedColumns as $column) {
if ($this->onSchemaAlterTableAddColumn($column, $diff, $columnSql)) { if ($this->onSchemaAlterTableAddColumn($column, $diff, $columnSql)) {
continue; continue;
...@@ -137,7 +136,6 @@ class SQLAnywherePlatform extends AbstractPlatform ...@@ -137,7 +136,6 @@ class SQLAnywherePlatform extends AbstractPlatform
); );
} }
/** @var Column $column */
foreach ($diff->removedColumns as $column) { foreach ($diff->removedColumns as $column) {
if ($this->onSchemaAlterTableRemoveColumn($column, $diff, $columnSql)) { if ($this->onSchemaAlterTableRemoveColumn($column, $diff, $columnSql)) {
continue; continue;
...@@ -146,7 +144,6 @@ class SQLAnywherePlatform extends AbstractPlatform ...@@ -146,7 +144,6 @@ class SQLAnywherePlatform extends AbstractPlatform
$alterClauses[] = $this->getAlterTableRemoveColumnClause($column); $alterClauses[] = $this->getAlterTableRemoveColumnClause($column);
} }
/** @var ColumnDiff $columnDiff */
foreach ($diff->changedColumns as $columnDiff) { foreach ($diff->changedColumns as $columnDiff) {
if ($this->onSchemaAlterTableChangeColumn($columnDiff, $diff, $columnSql)) { if ($this->onSchemaAlterTableChangeColumn($columnDiff, $diff, $columnSql)) {
continue; continue;
......
...@@ -460,7 +460,6 @@ SQL ...@@ -460,7 +460,6 @@ SQL
$columnSql = []; $columnSql = [];
$commentsSql = []; $commentsSql = [];
/** @var Column $column */
foreach ($diff->addedColumns as $column) { foreach ($diff->addedColumns as $column) {
if ($this->onSchemaAlterTableAddColumn($column, $diff, $columnSql)) { if ($this->onSchemaAlterTableAddColumn($column, $diff, $columnSql)) {
continue; continue;
...@@ -494,7 +493,6 @@ SQL ...@@ -494,7 +493,6 @@ SQL
$queryParts[] = 'DROP COLUMN ' . $column->getQuotedName($this); $queryParts[] = 'DROP COLUMN ' . $column->getQuotedName($this);
} }
/** @var ColumnDiff $columnDiff */
foreach ($diff->changedColumns as $columnDiff) { foreach ($diff->changedColumns as $columnDiff) {
if ($this->onSchemaAlterTableChangeColumn($columnDiff, $diff, $columnSql)) { if ($this->onSchemaAlterTableChangeColumn($columnDiff, $diff, $columnSql)) {
continue; continue;
......
...@@ -115,7 +115,6 @@ class SingleDatabaseSynchronizer extends AbstractSchemaSynchronizer ...@@ -115,7 +115,6 @@ class SingleDatabaseSynchronizer extends AbstractSchemaSynchronizer
$sm = $this->conn->getSchemaManager(); $sm = $this->conn->getSchemaManager();
$visitor = new DropSchemaSqlCollector($this->platform); $visitor = new DropSchemaSqlCollector($this->platform);
/** @var Schema $schema */
$schema = $sm->createSchema(); $schema = $sm->createSchema();
$schema->visit($visitor); $schema->visit($visitor);
......
...@@ -615,7 +615,6 @@ class Table extends AbstractAsset ...@@ -615,7 +615,6 @@ class Table extends AbstractAsset
{ {
$foreignKeyColumns = []; $foreignKeyColumns = [];
foreach ($this->getForeignKeys() as $foreignKey) { foreach ($this->getForeignKeys() as $foreignKey) {
/** @var ForeignKeyConstraint $foreignKey */
$foreignKeyColumns = array_merge($foreignKeyColumns, $foreignKey->getColumns()); $foreignKeyColumns = array_merge($foreignKeyColumns, $foreignKey->getColumns());
} }
return $this->filterColumns($foreignKeyColumns); return $this->filterColumns($foreignKeyColumns);
......
...@@ -21,7 +21,6 @@ use Doctrine\DBAL\Platforms\Keywords\SQLServer2005Keywords; ...@@ -21,7 +21,6 @@ use Doctrine\DBAL\Platforms\Keywords\SQLServer2005Keywords;
use Doctrine\DBAL\Platforms\Keywords\SQLServer2008Keywords; use Doctrine\DBAL\Platforms\Keywords\SQLServer2008Keywords;
use Doctrine\DBAL\Platforms\Keywords\SQLServer2012Keywords; use Doctrine\DBAL\Platforms\Keywords\SQLServer2012Keywords;
use Doctrine\DBAL\Platforms\Keywords\SQLServerKeywords; use Doctrine\DBAL\Platforms\Keywords\SQLServerKeywords;
use Doctrine\DBAL\Schema\Schema;
use InvalidArgumentException; use InvalidArgumentException;
use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputInterface;
...@@ -161,7 +160,6 @@ EOT ...@@ -161,7 +160,6 @@ EOT
$output->write('Checking keyword violations for <comment>' . implode(', ', $keywordLists) . '</comment>...', true); $output->write('Checking keyword violations for <comment>' . implode(', ', $keywordLists) . '</comment>...', true);
/** @var Schema $schema */
$schema = $conn->getSchemaManager()->createSchema(); $schema = $conn->getSchemaManager()->createSchema();
$visitor = new ReservedKeywordsValidator($keywords); $visitor = new ReservedKeywordsValidator($keywords);
$schema->visit($visitor); $schema->visit($visitor);
......
...@@ -5,7 +5,6 @@ namespace Doctrine\Tests\DBAL\Functional; ...@@ -5,7 +5,6 @@ namespace Doctrine\Tests\DBAL\Functional;
use Doctrine\DBAL\Driver\OCI8\Driver as OCI8Driver; use Doctrine\DBAL\Driver\OCI8\Driver as OCI8Driver;
use Doctrine\DBAL\FetchMode; use Doctrine\DBAL\FetchMode;
use Doctrine\DBAL\ParameterType; use Doctrine\DBAL\ParameterType;
use Doctrine\DBAL\Schema\AbstractSchemaManager;
use Doctrine\DBAL\Schema\Table; use Doctrine\DBAL\Schema\Table;
use Doctrine\DBAL\Types\Type; use Doctrine\DBAL\Types\Type;
use Doctrine\Tests\DbalFunctionalTestCase; use Doctrine\Tests\DbalFunctionalTestCase;
...@@ -22,7 +21,6 @@ class BlobTest extends DbalFunctionalTestCase ...@@ -22,7 +21,6 @@ class BlobTest extends DbalFunctionalTestCase
{ {
parent::setUp(); parent::setUp();
/** @var AbstractSchemaManager $sm */
$table = new Table('blob_table'); $table = new Table('blob_table');
$table->addColumn('id', 'integer'); $table->addColumn('id', 'integer');
$table->addColumn('clobfield', 'text'); $table->addColumn('clobfield', 'text');
......
...@@ -10,7 +10,6 @@ use Doctrine\DBAL\FetchMode; ...@@ -10,7 +10,6 @@ use Doctrine\DBAL\FetchMode;
use Doctrine\DBAL\ParameterType; use Doctrine\DBAL\ParameterType;
use Doctrine\DBAL\Platforms\SqlitePlatform; use Doctrine\DBAL\Platforms\SqlitePlatform;
use Doctrine\DBAL\Platforms\TrimMode; use Doctrine\DBAL\Platforms\TrimMode;
use Doctrine\DBAL\Schema\AbstractSchemaManager;
use Doctrine\DBAL\Schema\Table; use Doctrine\DBAL\Schema\Table;
use Doctrine\DBAL\Statement; use Doctrine\DBAL\Statement;
use Doctrine\DBAL\Types\Type; use Doctrine\DBAL\Types\Type;
...@@ -42,7 +41,6 @@ class DataAccessTest extends DbalFunctionalTestCase ...@@ -42,7 +41,6 @@ class DataAccessTest extends DbalFunctionalTestCase
return; return;
} }
/** @var AbstractSchemaManager $sm */
$table = new Table('fetch_table'); $table = new Table('fetch_table');
$table->addColumn('test_int', 'integer'); $table->addColumn('test_int', 'integer');
$table->addColumn('test_string', 'string'); $table->addColumn('test_string', 'string');
...@@ -601,7 +599,6 @@ class DataAccessTest extends DbalFunctionalTestCase ...@@ -601,7 +599,6 @@ class DataAccessTest extends DbalFunctionalTestCase
$table->addColumn('test_days', 'integer'); $table->addColumn('test_days', 'integer');
$table->setPrimaryKey(['test_date']); $table->setPrimaryKey(['test_date']);
/** @var AbstractSchemaManager $sm */
$sm = $this->connection->getSchemaManager(); $sm = $this->connection->getSchemaManager();
$sm->createTable($table); $sm->createTable($table);
......
...@@ -4,7 +4,6 @@ namespace Doctrine\Tests\DBAL\Functional; ...@@ -4,7 +4,6 @@ namespace Doctrine\Tests\DBAL\Functional;
use Doctrine\DBAL\Connections\MasterSlaveConnection; use Doctrine\DBAL\Connections\MasterSlaveConnection;
use Doctrine\DBAL\DriverManager; use Doctrine\DBAL\DriverManager;
use Doctrine\DBAL\Schema\AbstractSchemaManager;
use Doctrine\DBAL\Schema\Table; use Doctrine\DBAL\Schema\Table;
use Doctrine\Tests\DbalFunctionalTestCase; use Doctrine\Tests\DbalFunctionalTestCase;
use Throwable; use Throwable;
...@@ -32,7 +31,6 @@ class MasterSlaveConnectionTest extends DbalFunctionalTestCase ...@@ -32,7 +31,6 @@ class MasterSlaveConnectionTest extends DbalFunctionalTestCase
} }
try { try {
/** @var AbstractSchemaManager $sm */
$table = new Table('master_slave_table'); $table = new Table('master_slave_table');
$table->addColumn('test_int', 'integer'); $table->addColumn('test_int', 'integer');
$table->setPrimaryKey(['test_int']); $table->setPrimaryKey(['test_int']);
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
namespace Doctrine\Tests\DBAL\Functional; namespace Doctrine\Tests\DBAL\Functional;
use Doctrine\DBAL\Schema\AbstractSchemaManager;
use Doctrine\DBAL\Schema\Table; use Doctrine\DBAL\Schema\Table;
use Doctrine\Tests\DbalFunctionalTestCase; use Doctrine\Tests\DbalFunctionalTestCase;
use const CASE_LOWER; use const CASE_LOWER;
...@@ -19,7 +18,6 @@ class ModifyLimitQueryTest extends DbalFunctionalTestCase ...@@ -19,7 +18,6 @@ class ModifyLimitQueryTest extends DbalFunctionalTestCase
parent::setUp(); parent::setUp();
if (! self::$tableCreated) { if (! self::$tableCreated) {
/** @var AbstractSchemaManager $sm */
$table = new Table('modify_limit_table'); $table = new Table('modify_limit_table');
$table->addColumn('test_int', 'integer'); $table->addColumn('test_int', 'integer');
$table->setPrimaryKey(['test_int']); $table->setPrimaryKey(['test_int']);
......
...@@ -8,7 +8,6 @@ use Doctrine\DBAL\Driver\PDOSqlsrv\Driver; ...@@ -8,7 +8,6 @@ use Doctrine\DBAL\Driver\PDOSqlsrv\Driver;
use Doctrine\DBAL\DriverManager; use Doctrine\DBAL\DriverManager;
use Doctrine\DBAL\FetchMode; use Doctrine\DBAL\FetchMode;
use Doctrine\DBAL\Portability\Connection as ConnectionPortability; use Doctrine\DBAL\Portability\Connection as ConnectionPortability;
use Doctrine\DBAL\Schema\AbstractSchemaManager;
use Doctrine\DBAL\Schema\Table; use Doctrine\DBAL\Schema\Table;
use Doctrine\Tests\DbalFunctionalTestCase; use Doctrine\Tests\DbalFunctionalTestCase;
use Throwable; use Throwable;
...@@ -51,7 +50,6 @@ class PortabilityTest extends DbalFunctionalTestCase ...@@ -51,7 +50,6 @@ class PortabilityTest extends DbalFunctionalTestCase
$this->portableConnection = DriverManager::getConnection($params, $this->connection->getConfiguration(), $this->connection->getEventManager()); $this->portableConnection = DriverManager::getConnection($params, $this->connection->getConfiguration(), $this->connection->getEventManager());
try { try {
/** @var AbstractSchemaManager $sm */
$table = new Table('portability_table'); $table = new Table('portability_table');
$table->addColumn('Test_Int', 'integer'); $table->addColumn('Test_Int', 'integer');
$table->addColumn('Test_String', 'string', ['fixed' => true, 'length' => 32]); $table->addColumn('Test_String', 'string', ['fixed' => true, 'length' => 32]);
......
...@@ -397,7 +397,6 @@ class PostgreSqlSchemaManagerTest extends SchemaManagerFunctionalTestCase ...@@ -397,7 +397,6 @@ class PostgreSqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
$table->addColumn('foo', $type)->setPlatformOption('jsonb', true); $table->addColumn('foo', $type)->setPlatformOption('jsonb', true);
$this->schemaManager->dropAndCreateTable($table); $this->schemaManager->dropAndCreateTable($table);
/** @var Schema\Column[] $columns */
$columns = $this->schemaManager->listTableColumns('test_jsonb'); $columns = $this->schemaManager->listTableColumns('test_jsonb');
self::assertSame($type, $columns['foo']->getType()->getName()); self::assertSame($type, $columns['foo']->getType()->getName());
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
namespace Doctrine\Tests\DBAL\Functional; namespace Doctrine\Tests\DBAL\Functional;
use DateTime; use DateTime;
use Doctrine\DBAL\Schema\AbstractSchemaManager;
use Doctrine\DBAL\Schema\Table; use Doctrine\DBAL\Schema\Table;
use Doctrine\DBAL\Types\Type; use Doctrine\DBAL\Types\Type;
use Doctrine\Tests\DbalFunctionalTestCase; use Doctrine\Tests\DbalFunctionalTestCase;
...@@ -20,9 +19,6 @@ class TypeConversionTest extends DbalFunctionalTestCase ...@@ -20,9 +19,6 @@ class TypeConversionTest extends DbalFunctionalTestCase
{ {
parent::setUp(); parent::setUp();
/** @var AbstractSchemaManager $sm */
$sm = $this->connection->getSchemaManager();
$table = new Table('type_conversion'); $table = new Table('type_conversion');
$table->addColumn('id', 'integer', ['notnull' => false]); $table->addColumn('id', 'integer', ['notnull' => false]);
$table->addColumn('test_string', 'string', ['notnull' => false]); $table->addColumn('test_string', 'string', ['notnull' => false]);
......
...@@ -4,7 +4,6 @@ namespace Doctrine\Tests\DBAL\Functional; ...@@ -4,7 +4,6 @@ namespace Doctrine\Tests\DBAL\Functional;
use DateTime; use DateTime;
use Doctrine\DBAL\ParameterType; use Doctrine\DBAL\ParameterType;
use Doctrine\DBAL\Schema\AbstractSchemaManager;
use Doctrine\DBAL\Schema\Sequence; use Doctrine\DBAL\Schema\Sequence;
use Doctrine\DBAL\Schema\Table; use Doctrine\DBAL\Schema\Table;
use Doctrine\DBAL\Types\Type; use Doctrine\DBAL\Types\Type;
...@@ -20,7 +19,6 @@ class WriteTest extends DbalFunctionalTestCase ...@@ -20,7 +19,6 @@ class WriteTest extends DbalFunctionalTestCase
parent::setUp(); parent::setUp();
try { try {
/** @var AbstractSchemaManager $sm */
$table = new Table('write_table'); $table = new Table('write_table');
$table->addColumn('id', 'integer', ['autoincrement' => true]); $table->addColumn('id', 'integer', ['autoincrement' => true]);
$table->addColumn('test_int', 'integer'); $table->addColumn('test_int', 'integer');
......
...@@ -833,7 +833,6 @@ class ComparatorTest extends TestCase ...@@ -833,7 +833,6 @@ class ComparatorTest extends TestCase
$sequence = $schema->createSequence('baz'); $sequence = $schema->createSequence('baz');
$schemaNew = clone $schema; $schemaNew = clone $schema;
/** @var Schema $schemaNew */
$schemaNew->getSequence('baz')->setAllocationSize(20); $schemaNew->getSequence('baz')->setAllocationSize(20);
$c = new Comparator(); $c = new Comparator();
......
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