Skip to content

Commit

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

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 ef67967 commit 105bf49
Show file tree
Hide file tree
Showing 27 changed files with 2 additions and 58 deletions.
8 changes: 2 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,13 @@
"psr-4": {
"Ibexa\\DesignEngine\\": "src/lib/",
"Ibexa\\Bundle\\DesignEngine\\": "src/bundle/",
"Ibexa\\Contracts\\DesignEngine\\": "src/contracts/",
"EzSystems\\EzPlatformDesignEngine\\": "src/lib/",
"EzSystems\\EzPlatformDesignEngineBundle\\": "src/bundle/"
"Ibexa\\Contracts\\DesignEngine\\": "src/contracts/"
}
},
"autoload-dev": {
"psr-4": {
"Ibexa\\Tests\\Bundle\\DesignEngine\\": "tests/bundle/",
"Ibexa\\Tests\\DesignEngine\\": "tests/lib/",
"EzSystems\\EzPlatformDesignEngine\\Tests\\": "tests/lib",
"EzSystems\\EzPlatformDesignEngineBundle\\Tests\\": "tests/bundle"
"Ibexa\\Tests\\DesignEngine\\": "tests/lib/"
}
},
"scripts": {
Expand Down
2 changes: 0 additions & 2 deletions src/bundle/DataCollector/TwigDataCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,3 @@ public function getProfile()
return $profile;
}
}

class_alias(TwigDataCollector::class, 'EzSystems\EzPlatformDesignEngineBundle\DataCollector\TwigDataCollector');
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,3 @@ private function preResolveAssetsPaths(AssetPathProvisionerInterface $provisione
return $resolvedPathsByDesign;
}
}

class_alias(AssetPathResolutionPass::class, 'EzSystems\EzPlatformDesignEngineBundle\DependencyInjection\Compiler\AssetPathResolutionPass');
2 changes: 0 additions & 2 deletions src/bundle/DependencyInjection/Compiler/AssetThemePass.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,3 @@ public function process(ContainerBuilder $container)
->addMethodCall('addPackage', [DesignAwareInterface::DESIGN_NAMESPACE, $container->findDefinition(ThemePackage::class)]);
}
}

class_alias(AssetThemePass::class, 'EzSystems\EzPlatformDesignEngineBundle\DependencyInjection\Compiler\AssetThemePass');
2 changes: 0 additions & 2 deletions src/bundle/DependencyInjection/Compiler/TwigThemePass.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,5 +108,3 @@ public function process(ContainerBuilder $container)
$twigDataCollector->addArgument(new Reference(TemplatePathRegistry::class));
}
}

class_alias(TwigThemePass::class, 'EzSystems\EzPlatformDesignEngineBundle\DependencyInjection\Compiler\TwigThemePass');
2 changes: 0 additions & 2 deletions src/bundle/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,3 @@ public function getConfigTreeBuilder()
return $treeBuilder;
}
}

class_alias(Configuration::class, 'EzSystems\EzPlatformDesignEngineBundle\DependencyInjection\Configuration');
2 changes: 0 additions & 2 deletions src/bundle/DependencyInjection/DesignConfigParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,3 @@ public function addSemanticConfig(NodeBuilder $nodeBuilder)
->end();
}
}

class_alias(DesignConfigParser::class, 'EzSystems\EzPlatformDesignEngineBundle\DependencyInjection\DesignConfigParser');
2 changes: 0 additions & 2 deletions src/bundle/DependencyInjection/IbexaDesignEngineExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,3 @@ private function configureDesigns(array $config, ConfigurationProcessor $process
$container->setParameter('ibexa.design.assets.resolution.disabled', $config['disable_assets_pre_resolution']);
}
}

class_alias(IbexaDesignEngineExtension::class, 'EzSystems\EzPlatformDesignEngineBundle\DependencyInjection\EzPlatformDesignEngineExtension');
2 changes: 0 additions & 2 deletions src/bundle/IbexaDesignEngineBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,3 @@ public function getContainerExtension()
return $this->extension;
}
}

class_alias(IbexaDesignEngineBundle::class, 'EzSystems\EzPlatformDesignEngineBundle\EzPlatformDesignEngineBundle');
2 changes: 0 additions & 2 deletions src/contracts/DesignAwareInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,3 @@ interface DesignAwareInterface

public function getCurrentDesign(): ?string;
}

class_alias(DesignAwareInterface::class, 'EzSystems\EzPlatformDesignEngine\DesignAwareInterface');
2 changes: 0 additions & 2 deletions src/lib/Asset/AssetPathProvisionerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,3 @@ interface AssetPathProvisionerInterface
*/
public function provisionResolvedPaths(array $assetsPaths, $design);
}

class_alias(AssetPathProvisionerInterface::class, 'EzSystems\EzPlatformDesignEngine\Asset\AssetPathProvisionerInterface');
2 changes: 0 additions & 2 deletions src/lib/Asset/AssetPathResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,3 @@ public function resolveAssetPath($path, $design)
return $path;
}
}

class_alias(AssetPathResolver::class, 'EzSystems\EzPlatformDesignEngine\Asset\AssetPathResolver');
2 changes: 0 additions & 2 deletions src/lib/Asset/AssetPathResolverInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,3 @@ interface AssetPathResolverInterface
*/
public function resolveAssetPath($path, $design);
}

class_alias(AssetPathResolverInterface::class, 'EzSystems\EzPlatformDesignEngine\Asset\AssetPathResolverInterface');
2 changes: 0 additions & 2 deletions src/lib/Asset/ProvisionedPathResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,3 @@ private function computeLogicalPathFromPhysicalAssets($themePath)
return $logicalPaths;
}
}

class_alias(ProvisionedPathResolver::class, 'EzSystems\EzPlatformDesignEngine\Asset\ProvisionedPathResolver');
2 changes: 0 additions & 2 deletions src/lib/Asset/ThemePackage.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,3 @@ public function getVersion($path)
return $this->innerPackage->getVersion($this->pathResolver->resolveAssetPath($path, $this->getCurrentDesign()));
}
}

class_alias(ThemePackage::class, 'EzSystems\EzPlatformDesignEngine\Asset\ThemePackage');
2 changes: 0 additions & 2 deletions src/lib/DesignAwareTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,3 @@ public function getCurrentDesign(): ?string
return $this->configResolver->getParameter('design');
}
}

class_alias(DesignAwareTrait::class, 'EzSystems\EzPlatformDesignEngine\DesignAwareTrait');
2 changes: 0 additions & 2 deletions src/lib/Exception/InvalidDesignException.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,3 @@
class InvalidDesignException extends InvalidArgumentException
{
}

class_alias(InvalidDesignException::class, 'EzSystems\EzPlatformDesignEngine\Exception\InvalidDesignException');
2 changes: 0 additions & 2 deletions src/lib/Templating/TemplateNameResolverInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,3 @@ public function resolveTemplateName($name);
*/
public function isTemplateDesignNamespaced($name);
}

class_alias(TemplateNameResolverInterface::class, 'EzSystems\EzPlatformDesignEngine\Templating\TemplateNameResolverInterface');
2 changes: 0 additions & 2 deletions src/lib/Templating/TemplatePathRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,3 @@ public function __unserialize(array $data): void
[$this->pathMap, $this->kernelRootDir] = $data;
}
}

class_alias(TemplatePathRegistry::class, 'EzSystems\EzPlatformDesignEngine\Templating\TemplatePathRegistry');
2 changes: 0 additions & 2 deletions src/lib/Templating/TemplatePathRegistryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,3 @@ public function getTemplatePath($templateName);
*/
public function getPathMap();
}

class_alias(TemplatePathRegistryInterface::class, 'EzSystems\EzPlatformDesignEngine\Templating\TemplatePathRegistryInterface');
2 changes: 0 additions & 2 deletions src/lib/Templating/ThemeTemplateNameResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,3 @@ public function isTemplateDesignNamespaced($name)
return (strpos($name, '@' . static::DESIGN_NAMESPACE) !== false) || (strpos($name, '@' . $this->getCurrentDesign()) !== false);
}
}

class_alias(ThemeTemplateNameResolver::class, 'EzSystems\EzPlatformDesignEngine\Templating\ThemeTemplateNameResolver');
2 changes: 0 additions & 2 deletions src/lib/Templating/Twig/TwigThemeLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,3 @@ public function prependPath($path, $namespace = FilesystemLoader::MAIN_NAMESPACE
$this->innerFilesystemLoader->prependPath($path, $namespace);
}
}

class_alias(TwigThemeLoader::class, 'EzSystems\EzPlatformDesignEngine\Templating\Twig\TwigThemeLoader');
2 changes: 0 additions & 2 deletions tests/lib/Asset/AssetPathResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,5 +132,3 @@ public function testResolveAssetPath(array $designPaths, array $existingPaths, $
self::assertSame($resolvedPath, $resolver->resolveAssetPath($path, 'foo'));
}
}

class_alias(AssetPathResolverTest::class, 'EzSystems\EzPlatformDesignEngine\Tests\Asset\AssetPathResolverTest');
2 changes: 0 additions & 2 deletions tests/lib/Asset/ProvisionedPathResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,5 +112,3 @@ public function testProvisionResolvedPaths()
self::assertEquals($expectedResolvedPaths, $provisioner->provisionResolvedPaths($themesPaths, $design));
}
}

class_alias(ProvisionedPathResolverTest::class, 'EzSystems\EzPlatformDesignEngine\Tests\Asset\ProvisionedPathResolverTest');
2 changes: 0 additions & 2 deletions tests/lib/Asset/ThemePackageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,3 @@ public function testGetVersion()
self::assertSame($version, $package->getVersion($assetPath));
}
}

class_alias(ThemePackageTest::class, 'EzSystems\EzPlatformDesignEngine\Tests\Asset\ThemePackageTest');
2 changes: 0 additions & 2 deletions tests/lib/Templating/TemplatePathRegistryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,3 @@ public function testGetTemplatePathNotMapped()
self::assertSame($templateLogicalName, $registry->getTemplatePath($templateLogicalName));
}
}

class_alias(TemplatePathRegistryTest::class, 'EzSystems\EzPlatformDesignEngine\Tests\Templating\TemplatePathRegistryTest');
2 changes: 0 additions & 2 deletions tests/lib/Templating/ThemeTemplateNameResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,3 @@ public function testIsTemplateDesignNamespaced($currentDesign, $templateName, $e
self::assertSame($expected, $resolver->isTemplateDesignNamespaced($templateName));
}
}

class_alias(ThemeTemplateNameResolverTest::class, 'EzSystems\EzPlatformDesignEngine\Tests\Templating\ThemeTemplateNameResolverTest');

0 comments on commit 105bf49

Please sign in to comment.