Skip to content

Commit

Permalink
IBX-8139: Dropped class_alias BC layer statements from all classes (#25)
Browse files Browse the repository at this point in the history
For more details see https://issues.ibexa.co/browse/IBX-8139 and #25

Key changes:

* Dropped class_alias BC layer from production code

* Dropped class_alias BC layer from test code

* [Composer] Dropped legacy namespaces from autoload section
  • Loading branch information
alongosz authored Jun 5, 2024
1 parent 6e98faf commit e5e3745
Show file tree
Hide file tree
Showing 27 changed files with 1 addition and 55 deletions.
4 changes: 1 addition & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@
"psr-4": {
"Ibexa\\DoctrineSchema\\": "src/lib/",
"Ibexa\\Bundle\\DoctrineSchema\\": "src/bundle/",
"Ibexa\\Contracts\\DoctrineSchema\\": "src/contracts/",
"EzSystems\\DoctrineSchemaBundle\\": "src/bundle",
"EzSystems\\DoctrineSchema\\": "src/lib"
"Ibexa\\Contracts\\DoctrineSchema\\": "src/contracts/"
}
},
"autoload-dev": {
Expand Down
2 changes: 0 additions & 2 deletions src/bundle/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,3 @@ public function getConfigTreeBuilder(): TreeBuilder
return $treeBuilder;
}
}

class_alias(Configuration::class, 'EzSystems\DoctrineSchemaBundle\DependencyInjection\Configuration');
2 changes: 0 additions & 2 deletions src/bundle/DependencyInjection/DoctrineSchemaExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,3 @@ public function load(array $configs, ContainerBuilder $container)
}
}
}

class_alias(DoctrineSchemaExtension::class, 'EzSystems\DoctrineSchemaBundle\DependencyInjection\DoctrineSchemaExtension');
2 changes: 0 additions & 2 deletions src/bundle/DoctrineSchemaBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,3 @@ public function getContainerExtension(): ExtensionInterface
return new DoctrineSchemaExtension();
}
}

class_alias(DoctrineSchemaBundle::class, 'EzSystems\DoctrineSchemaBundle\DoctrineSchemaBundle');
2 changes: 0 additions & 2 deletions src/contracts/Builder/SchemaBuilderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,3 @@ public function buildSchema(): Schema;
*/
public function importSchemaFromFile(string $schemaFilePath): Schema;
}

class_alias(SchemaBuilderInterface::class, 'EzSystems\DoctrineSchema\API\Builder\SchemaBuilder');
2 changes: 0 additions & 2 deletions src/contracts/DbPlatformFactoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,3 @@ interface DbPlatformFactoryInterface
*/
public function createDatabasePlatformFromDriverName(string $driverName): ?AbstractPlatform;
}

class_alias(DbPlatformFactoryInterface::class, 'EzSystems\DoctrineSchema\API\DbPlatformFactory');
2 changes: 0 additions & 2 deletions src/contracts/Event/SchemaBuilderEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,3 @@ public function getSchemaBuilder(): SchemaBuilderInterface
return $this->schemaBuilder;
}
}

class_alias(SchemaBuilderEvent::class, 'EzSystems\DoctrineSchema\API\Event\SchemaBuilderEvent');
2 changes: 0 additions & 2 deletions src/contracts/Exception/InvalidConfigurationException.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,3 @@ public function __construct(string $message = '', int $code = 1, Throwable $prev
parent::__construct("Invalid schema configuration: {$message}", $code, $previous);
}
}

class_alias(InvalidConfigurationException::class, 'EzSystems\DoctrineSchema\API\Exception\InvalidConfigurationException');
2 changes: 0 additions & 2 deletions src/contracts/SchemaBuilderEvents.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,3 @@ class SchemaBuilderEvents
{
public const BUILD_SCHEMA = 'ibexa.schema.build_schema';
}

class_alias(SchemaBuilderEvents::class, 'EzSystems\DoctrineSchema\API\Event\SchemaBuilderEvents');
2 changes: 0 additions & 2 deletions src/contracts/SchemaExporterInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,3 @@ interface SchemaExporterInterface
*/
public function export(Schema $schemaDefinition): string;
}

class_alias(SchemaExporterInterface::class, 'EzSystems\DoctrineSchema\API\SchemaExporter');
2 changes: 0 additions & 2 deletions src/contracts/SchemaImporterInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,3 @@ public function importFromFile(string $schemaFilePath, ?Schema $targetSchema = n
*/
public function importFromSource(string $schemaDefinition, ?Schema $targetSchema = null): Schema;
}

class_alias(SchemaImporterInterface::class, 'EzSystems\DoctrineSchema\API\SchemaImporter');
2 changes: 0 additions & 2 deletions src/lib/Builder/SchemaBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,3 @@ public function importSchemaFromFile(string $schemaFilePath): Schema
return $this->schemaImporter->importFromFile($schemaFilePath, $this->schema);
}
}

class_alias(SchemaBuilder::class, 'EzSystems\DoctrineSchema\Builder\SchemaBuilder');
2 changes: 0 additions & 2 deletions src/lib/Database/DbPlatform/DbPlatformInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,3 @@ public function getDriverName(): string;
*/
public function addEventSubscribers(EventManager $eventManager): void;
}

class_alias(DbPlatformInterface::class, 'EzSystems\DoctrineSchema\Database\DbPlatform\DbPlatform');
2 changes: 0 additions & 2 deletions src/lib/Database/DbPlatform/PostgreSqlDbPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,3 @@ public function getDropTableSQL($table): string
return 'DROP TABLE IF EXISTS ' . $table . ' CASCADE';
}
}

class_alias(PostgreSqlDbPlatform::class, 'EzSystems\DoctrineSchema\Database\DbPlatform\PostgreSqlDbPlatform');
2 changes: 0 additions & 2 deletions src/lib/Database/DbPlatform/SqliteDbPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,3 @@ public function getCreateForeignKeySQL(ForeignKeyConstraint $foreignKey, $table)
return '-- ';
}
}

class_alias(SqliteDbPlatform::class, 'EzSystems\DoctrineSchema\Database\DbPlatform\SqliteDbPlatform');
2 changes: 0 additions & 2 deletions src/lib/Database/DbPlatformFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,3 @@ public function createDatabasePlatformFromDriverName(string $driverName): ?Abstr
return $this->dbPlatforms[$driverName] ?? null;
}
}

class_alias(DbPlatformFactory::class, 'EzSystems\DoctrineSchema\Database\DbPlatformFactory');
2 changes: 0 additions & 2 deletions src/lib/Exporter/SchemaExporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,3 @@ public function export(Schema $schema): string
return Yaml::dump($schemaDefinition, 4);
}
}

class_alias(SchemaExporter::class, 'EzSystems\DoctrineSchema\Exporter\SchemaExporter');
2 changes: 0 additions & 2 deletions src/lib/Exporter/Table/SchemaTableExporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,5 +151,3 @@ private function exportForeignKeys(array $tableMetadata, Table $table): array
return $tableMetadata;
}
}

class_alias(SchemaTableExporter::class, 'EzSystems\DoctrineSchema\Exporter\Table\SchemaTableExporter');
2 changes: 0 additions & 2 deletions src/lib/Importer/SchemaImporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -271,5 +271,3 @@ private function normalizeIndexConfig($indexConfig, string $location): array
return $indexConfig;
}
}

class_alias(SchemaImporter::class, 'EzSystems\DoctrineSchema\Importer\SchemaImporter');
2 changes: 0 additions & 2 deletions tests/lib/Builder/SchemaBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,3 @@ public function onBuildSchema(SchemaBuilderEvent $event)
);
}
}

class_alias(SchemaBuilderTest::class, 'EzSystems\Tests\DoctrineSchema\Builder\SchemaBuilderTest');
2 changes: 0 additions & 2 deletions tests/lib/Database/Builder/MySqlTestDatabaseBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,3 @@ public function buildDatabase(): Connection
return $connection;
}
}

class_alias(MySqlTestDatabaseBuilder::class, 'EzSystems\Tests\DoctrineSchema\Database\Builder\MySqlTestDatabaseBuilder');
2 changes: 0 additions & 2 deletions tests/lib/Database/Builder/SqliteTestDatabaseBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,3 @@ public function buildDatabase(): Connection
);
}
}

class_alias(SqliteTestDatabaseBuilder::class, 'EzSystems\Tests\DoctrineSchema\Database\Builder\SqliteTestDatabaseBuilder');
2 changes: 0 additions & 2 deletions tests/lib/Database/Builder/TestDatabaseBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,3 @@ interface TestDatabaseBuilder
*/
public function buildDatabase(): Connection;
}

class_alias(TestDatabaseBuilder::class, 'EzSystems\Tests\DoctrineSchema\Database\Builder\TestDatabaseBuilder');
2 changes: 0 additions & 2 deletions tests/lib/Database/DbPlatform/SqliteDbPlatformTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,3 @@ public function testForeignKeys(): void
$connection->insert($secondaryTable->getName(), ['id' => 2], [ParameterType::INTEGER]);
}
}

class_alias(SqliteDbPlatformTest::class, 'EzSystems\Tests\DoctrineSchema\Database\DbPlatform\SqliteDbPlatformTest');
2 changes: 0 additions & 2 deletions tests/lib/Database/TestDatabaseConfigurationException.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,3 @@
class TestDatabaseConfigurationException extends \Exception
{
}

class_alias(TestDatabaseConfigurationException::class, 'EzSystems\Tests\DoctrineSchema\Database\TestDatabaseConfigurationException');
2 changes: 0 additions & 2 deletions tests/lib/Database/TestDatabaseFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,3 @@ public function prepareAndConnect(AbstractPlatform $databasePlatform): Connectio
return $this->databaseBuildersForPlatforms[$name]->buildDatabase();
}
}

class_alias(TestDatabaseFactory::class, 'EzSystems\Tests\DoctrineSchema\Database\TestDatabaseFactory');
2 changes: 0 additions & 2 deletions tests/lib/Exporter/SchemaExporterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,5 +135,3 @@ private function getDatabaseConnection(AbstractPlatform $databasePlatform): Conn
return $this->testDatabaseFactory->prepareAndConnect($databasePlatform);
}
}

class_alias(SchemaExporterTest::class, 'EzSystems\Tests\DoctrineSchema\Exporter\SchemaExporterTest');

0 comments on commit e5e3745

Please sign in to comment.