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