Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IBX-8139: Dropped class_alias BC layer statements from all classes #10

Merged
merged 5 commits into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 17 additions & 12 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,30 +38,34 @@
"ibexa/admin-ui": "~5.0.0@dev"
},
"require-dev": {
"squizlabs/php_codesniffer": "^3.2",
"phpmd/phpmd": "^2.6",
"phpunit/phpunit": "^8.5",
"ibexa/code-style": "^1.0",
"dg/bypass-finals": "^1.3",
"ibexa/code-style": "^1.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll need to update the code style in a separate PR. I'll take care of it.

"ibexa/content-forms": "~5.0.x-dev",
"ibexa/design-engine": "~5.0.x-dev",
"ibexa/doctrine-schema": "~5.0.x-dev",
"ibexa/http-cache": "~5.0.x-dev",
"ibexa/notifications": "~5.0.x-dev",
"ibexa/rest": "~5.0.x-dev",
"ibexa/search": "~5.0.x-dev",
"ibexa/user": "~5.0.x-dev",
"phpmd/phpmd": "^2.6",
"phpstan/phpstan": "^1.2",
"phpstan/phpstan-phpunit": "^1.0",
"phpstan/phpstan-symfony": "^1.0"
"phpstan/phpstan-symfony": "^1.0",
"phpunit/phpunit": "^8.5",
"squizlabs/php_codesniffer": "^3.2"
},
"autoload": {
"psr-4": {
"Ibexa\\AutomatedTranslation\\": "src/lib/",
"Ibexa\\Bundle\\AutomatedTranslation\\": "src/bundle/",
"Ibexa\\Contracts\\AutomatedTranslation\\": "src/contracts/",
"EzSystems\\EzPlatformAutomatedTranslation\\": "src/lib/",
"EzSystems\\EzPlatformAutomatedTranslationBundle\\": "src/bundle/"
"Ibexa\\Contracts\\AutomatedTranslation\\": "src/contracts/"
}
},
"autoload-dev": {
"psr-4": {
"Ibexa\\Tests\\AutomatedTranslation\\": "tests/lib/",
"Ibexa\\Tests\\Bundle\\AutomatedTranslation\\": "tests/bundle/",
"EzSystems\\EzPlatformAutomatedTranslation\\Tests\\": "tests/lib/",
"EzSystems\\EzPlatformAutomatedTranslationBundle\\Tests\\": "tests/bundle/"
"Ibexa\\Tests\\Bundle\\AutomatedTranslation\\": "tests/bundle/"
}
},
"scripts": {
Expand All @@ -83,7 +87,8 @@
"config": {
"sort-packages": true,
"allow-plugins": {
"composer/package-versions-deprecated": true
"composer/package-versions-deprecated": true,
"php-http/discovery": false
}
},
"extra": {
Expand Down
2 changes: 0 additions & 2 deletions src/bundle/Command/TranslateContentCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,3 @@ protected function initialize(InputInterface $input, OutputInterface $output): v
);
}
}

class_alias(TranslateContentCommand::class, 'EzSystems\EzPlatformAutomatedTranslationBundle\Command\TranslateContentCommand');
2 changes: 0 additions & 2 deletions src/bundle/Controller/TranslationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,3 @@ private function targetUrlContainsPattern(string $targetUrl, string $pattern): b
return 1 === preg_match("#{$pattern}#", $targetUrl);
}
}

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

class_alias(Configuration::class, 'EzSystems\EzPlatformAutomatedTranslationBundle\DependencyInjection\Configuration');
Original file line number Diff line number Diff line change
Expand Up @@ -94,5 +94,3 @@ private function prependJMSTranslation(ContainerBuilder $container): void
]);
}
}

class_alias(IbexaAutomatedTranslationExtension::class, 'EzSystems\EzPlatformAutomatedTranslationBundle\DependencyInjection\EzPlatformAutomatedTranslationExtension');
2 changes: 0 additions & 2 deletions src/bundle/Event/FieldDecodeEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,3 @@ public function setPreviousValue($previousValue): void
$this->previousValue = $previousValue;
}
}

class_alias(FieldDecodeEvent::class, 'EzSystems\EzPlatformAutomatedTranslationBundle\Event\FieldDecodeEvent');
2 changes: 0 additions & 2 deletions src/bundle/Event/FieldEncodeEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,3 @@ public function setValue(string $value): void
$this->value = $value;
}
}

class_alias(FieldEncodeEvent::class, 'EzSystems\EzPlatformAutomatedTranslationBundle\Event\FieldEncodeEvent');
2 changes: 0 additions & 2 deletions src/bundle/EventListener/ContentProxyTranslateListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,3 @@ public function translate(ContentProxyTranslateEvent $event): void
$event->setResponse($response);
}
}

class_alias(ContentProxyTranslateListener::class, 'EzSystems\EzPlatformAutomatedTranslationBundle\EventListener\ContentProxyTranslateListener');
2 changes: 0 additions & 2 deletions src/bundle/Events.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,3 @@ final class Events
*/
public const POST_FIELD_DECODE = 'ibexa.automated_translation.post_field_decode';
}

class_alias(Events::class, 'EzSystems\EzPlatformAutomatedTranslationBundle\Events');
2 changes: 0 additions & 2 deletions src/bundle/Form/Data/TranslationAddData.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,3 @@ public function setTranslatorAlias($translatorAlias): void
$this->translatorAlias = $translatorAlias;
}
}

class_alias(TranslationAddData::class, 'EzSystems\EzPlatformAutomatedTranslationBundle\Form\Data\TranslationAddData');
2 changes: 0 additions & 2 deletions src/bundle/Form/Extension/ContentEditType.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,3 @@ function (FormEvent $event) {
);
}
}

class_alias(ContentEditType::class, 'EzSystems\EzPlatformAutomatedTranslationBundle\Form\Extension\ContentEditType');
2 changes: 0 additions & 2 deletions src/bundle/Form/Extension/LanguageCreateType.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,3 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
);
}
}

class_alias(LanguageCreateType::class, 'EzSystems\EzPlatformAutomatedTranslationBundle\Form\Extension\LanguageCreateType');
2 changes: 0 additions & 2 deletions src/bundle/Form/Extension/TranslationAddType.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,5 +133,3 @@ public function configureOptions(OptionsResolver $resolver): void
$resolver->setDefaults([]);
}
}

class_alias(TranslationAddType::class, 'EzSystems\EzPlatformAutomatedTranslationBundle\Form\Extension\TranslationAddType');
2 changes: 0 additions & 2 deletions src/bundle/Form/TranslationAddDataTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,3 @@ public function reverseTransform($value): TranslationAddData
return $value;
}
}

class_alias(TranslationAddDataTransformer::class, 'EzSystems\EzPlatformAutomatedTranslationBundle\Form\TranslationAddDataTransformer');
2 changes: 0 additions & 2 deletions src/bundle/IbexaAutomatedTranslationBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,3 @@ public function build(ContainerBuilder $container): void
parent::build($container);
}
}

class_alias(IbexaAutomatedTranslationBundle::class, 'EzSystems\EzPlatformAutomatedTranslationBundle\EzPlatformAutomatedTranslationBundle');
2 changes: 0 additions & 2 deletions src/contracts/Client/ClientInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,3 @@ public function getServiceAlias(): string;
*/
public function getServiceFullName(): string;
}

class_alias(ClientInterface::class, 'EzSystems\EzPlatformAutomatedTranslation\Client\ClientInterface');
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,3 @@ public function encode($value): string;

public function decode(string $value): string;
}

class_alias(BlockAttributeEncoderInterface::class, 'EzSystems\EzPlatformAutomatedTranslation\Encoder\BlockAttribute\BlockAttributeEncoderInterface');
2 changes: 0 additions & 2 deletions src/contracts/Encoder/Field/FieldEncoderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,3 @@ public function encode(Field $field): string;
*/
public function decode(string $value, $previousFieldValue): Value;
}

class_alias(FieldEncoderInterface::class, 'EzSystems\EzPlatformAutomatedTranslation\Encoder\Field\FieldEncoderInterface');
2 changes: 0 additions & 2 deletions src/lib/Client/Deepl.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,3 @@ private function normalized(string $languageCode): string
*/
private const LANGUAGE_CODES = ['EN', 'DE', 'FR', 'ES', 'IT', 'NL', 'PL'];
}

class_alias(Deepl::class, 'EzSystems\EzPlatformAutomatedTranslation\Client\Deepl');
2 changes: 0 additions & 2 deletions src/lib/Client/Google.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,5 +121,3 @@ private function normalized(string $languageCode): string
throw new InvalidLanguageCodeException($languageCode, $this->getServiceAlias());
}
}

class_alias(Google::class, 'EzSystems\EzPlatformAutomatedTranslation\Client\Google');
2 changes: 0 additions & 2 deletions src/lib/ClientProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,3 @@ public function getClients(): array
return $this->clients;
}
}

class_alias(ClientProvider::class, 'EzSystems\EzPlatformAutomatedTranslation\ClientProvider');
2 changes: 0 additions & 2 deletions src/lib/Encoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,5 +208,3 @@ private function decodeField(string $type, string $value, $previousFieldValue):
return $event->getValue();
}
}

class_alias(Encoder::class, 'EzSystems\EzPlatformAutomatedTranslation\Encoder');
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,3 @@ public function decode(string $type, string $value): string
);
}
}

class_alias(BlockAttributeEncoderManager::class, 'EzSystems\EzPlatformAutomatedTranslation\Encoder\BlockAttribute\BlockAttributeEncoderManager');
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,3 @@ public function decode(string $value): string
return $decodedValue;
}
}

class_alias(RichTextBlockAttributeEncoder::class, 'EzSystems\EzPlatformAutomatedTranslation\Encoder\BlockAttribute\RichTextBlockAttributeEncoder');
2 changes: 0 additions & 2 deletions src/lib/Encoder/BlockAttribute/TextBlockAttributeEncoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,3 @@ public function decode(string $value): string
return $value;
}
}

class_alias(TextBlockAttributeEncoder::class, 'EzSystems\EzPlatformAutomatedTranslation\Encoder\BlockAttribute\TextBlockAttributeEncoder');
2 changes: 0 additions & 2 deletions src/lib/Encoder/Field/FieldEncoderManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,3 @@ public function decode(string $type, string $value, $previousFieldValue): Value
);
}
}

class_alias(FieldEncoderManager::class, 'EzSystems\EzPlatformAutomatedTranslation\Encoder\Field\FieldEncoderManager');
2 changes: 0 additions & 2 deletions src/lib/Encoder/Field/PageBuilderFieldEncoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,5 +150,3 @@ private function decodeBlockAttribute(string $type, string $value): ?string
return $value;
}
}

class_alias(PageBuilderFieldEncoder::class, 'EzSystems\EzPlatformAutomatedTranslation\Encoder\Field\PageBuilderFieldEncoder');
2 changes: 0 additions & 2 deletions src/lib/Encoder/Field/RichTextFieldEncoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,3 @@ public function decode(string $value, $previousFieldValue): Value
return new RichTextValue($decodedValue);
}
}

class_alias(RichTextFieldEncoder::class, 'EzSystems\EzPlatformAutomatedTranslation\Encoder\Field\RichTextFieldEncoder');
2 changes: 0 additions & 2 deletions src/lib/Encoder/Field/TextLineFieldEncoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,3 @@ public function decode(string $value, $previousFieldValue): Value
return new TextLineValue($value);
}
}

class_alias(TextLineFieldEncoder::class, 'EzSystems\EzPlatformAutomatedTranslation\Encoder\Field\TextLineFieldEncoder');
2 changes: 0 additions & 2 deletions src/lib/Encoder/RichText/RichTextEncoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,5 +208,3 @@ private function decodeNonTranslatableCharacters(string $value): string
);
}
}

class_alias(RichTextEncoder::class, 'EzSystems\EzPlatformAutomatedTranslation\Encoder\RichText\RichTextEncoder');
2 changes: 0 additions & 2 deletions src/lib/Exception/ClientNotConfiguredException.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,3 @@
class ClientNotConfiguredException extends RuntimeException
{
}

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

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

class_alias(EmptyTranslatedFieldException::class, 'EzSystems\EzPlatformAutomatedTranslation\Exception\EmptyTranslatedFieldException');
2 changes: 0 additions & 2 deletions src/lib/Exception/InvalidLanguageCodeException.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,3 @@ public function __construct(string $languageCode, string $driver)
parent::__construct("$languageCode not recognized by $driver");
}
}

class_alias(InvalidLanguageCodeException::class, 'EzSystems\EzPlatformAutomatedTranslation\Exception\InvalidLanguageCodeException');
2 changes: 0 additions & 2 deletions src/lib/Translator.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,3 @@ public function getTranslatedContent(string $from, string $to, string $remoteSer
return $this->contentService->updateContent($contentDraft->versionInfo, $contentUpdateStruct);
}
}

class_alias(Translator::class, 'EzSystems\EzPlatformAutomatedTranslation\Translator');
2 changes: 0 additions & 2 deletions src/lib/TranslatorGuard.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,3 @@ public function fetchContent(Content $content, ?string $languageCode): Content
return $this->contentService->loadContentByContentInfo($content->contentInfo, [$languageCode]);
}
}

class_alias(TranslatorGuard::class, 'EzSystems\EzPlatformAutomatedTranslation\TranslatorGuard');
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,3 @@ function ($method, $params) {
$this->assertEquals($expected, $hasConfiguredClientsResult);
}
}

class_alias(IbexaAutomatedTranslationExtensionTest::class, 'EzSystems\EzPlatformAutomatedTranslationBundle\Tests\DependencyInjection\EzPlatformAutomatedTranslationExtensionTest');
2 changes: 0 additions & 2 deletions tests/lib/Encoder/Field/RichTextFieldEncoderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,3 @@ protected function getFixture(string $name): string
return (string) file_get_contents(__DIR__ . '/../../../fixtures/' . $name);
}
}

class_alias(RichTextFieldEncoderTest::class, 'EzSystems\EzPlatformAutomatedTranslation\Tests\Encoder\Field\RichTextFieldEncoderTest');
2 changes: 0 additions & 2 deletions tests/lib/Encoder/Field/TextLineFieldEncoderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,3 @@ public function testDecode(): void
$this->assertEquals(new TextLine\Value('Some text 1'), $result);
}
}

class_alias(TextLineFieldEncoderTest::class, 'EzSystems\EzPlatformAutomatedTranslation\Tests\Encoder\Field\TextLineFieldEncoderTest');
2 changes: 0 additions & 2 deletions tests/lib/Encoder/RichText/RichTextEncoderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,3 @@ protected function getFixture(string $name): string
return (string) file_get_contents(__DIR__ . '/../../../fixtures/' . $name);
}
}

class_alias(RichTextEncoderTest::class, 'EzSystems\EzPlatformAutomatedTranslation\Tests\Encoder\RichText\RichTextEncoderTest');
2 changes: 0 additions & 2 deletions tests/lib/EncoderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,5 +148,3 @@ protected function getFixture(string $name): string
return (string) file_get_contents(__DIR__ . '/../fixtures/' . $name);
}
}

class_alias(EncoderTest::class, 'EzSystems\EzPlatformAutomatedTranslation\Tests\EncoderTest');
Loading