Skip to content

Commit

Permalink
[Rector] Applied all Symfony 5.x rectors to the production codebase
Browse files Browse the repository at this point in the history
Applied rules:
 * AddReturnTypeDeclarationBasedOnParentClassMethodRector
 * AddReturnTypeDeclarationRector
  • Loading branch information
alongosz committed Aug 6, 2024
1 parent 78f1364 commit 8b3e598
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/bundle/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Configuration extends SiteAccessConfiguration
*
* @return \Symfony\Component\Config\Definition\Builder\TreeBuilder The tree builder
*/
public function getConfigTreeBuilder()
public function getConfigTreeBuilder(): TreeBuilder
{
$treeBuilder = new TreeBuilder(IbexaFieldTypeRichTextExtension::EXTENSION_NAME);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

use Ibexa\Contracts\Core\Container\Encore\ConfigurationDumper as IbexaEncoreConfigurationDumper;
use Ibexa\Contracts\FieldTypeRichText\Configuration\Provider;
use Symfony\Component\Config\Definition\ConfigurationInterface;
use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\Config\Resource\FileResource;
Expand Down Expand Up @@ -39,7 +40,7 @@ class IbexaFieldTypeRichTextExtension extends Extension implements PrependExtens
],
];

public function getAlias()
public function getAlias(): string
{
return self::EXTENSION_NAME;
}
Expand Down Expand Up @@ -193,7 +194,7 @@ private function prependJMSTranslation(ContainerBuilder $container): void
]);
}

public function getConfiguration(array $config, ContainerBuilder $container)
public function getConfiguration(array $config, ContainerBuilder $container): ?ConfigurationInterface
{
return new Configuration();
}
Expand Down
3 changes: 2 additions & 1 deletion src/bundle/IbexaFieldTypeRichTextBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use Ibexa\Bundle\FieldTypeRichText\DependencyInjection\Configuration\Parser\FieldType\RichText;
use Ibexa\Bundle\FieldTypeRichText\DependencyInjection\IbexaFieldTypeRichTextExtension;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
use Symfony\Component\HttpKernel\Bundle\Bundle;

/**
Expand Down Expand Up @@ -47,7 +48,7 @@ protected function getCoreExtension(ContainerBuilder $container): IbexaCoreExten
return $container->getExtension('ibexa');
}

public function getContainerExtension()
public function getContainerExtension(): ?ExtensionInterface
{
if (!isset($this->extension)) {
$this->extension = new IbexaFieldTypeRichTextExtension();
Expand Down
2 changes: 1 addition & 1 deletion src/lib/FieldType/RichText/Value.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function __construct($xml = null)
/**
* @see \Ibexa\Core\FieldType\Value
*/
public function __toString()
public function __toString(): string
{
return isset($this->xml) ? (string)$this->xml->saveXML() : self::EMPTY_VALUE;
}
Expand Down
4 changes: 2 additions & 2 deletions src/lib/Form/Type/RichTextFieldType.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ public function getName()
return $this->getBlockPrefix();
}

public function getBlockPrefix()
public function getBlockPrefix(): string
{
return 'ezplatform_fieldtype_ezrichtext';
}

public function getParent()
public function getParent(): ?string
{
return TextareaType::class;
}
Expand Down

0 comments on commit 8b3e598

Please sign in to comment.