Skip to content

Commit

Permalink
Revert readonly properties (#1225)
Browse files Browse the repository at this point in the history
* Revert "Drop old versions of PHP and Symfony (#1223)"

This reverts commit 4153551.

* Update composer.json

* Rector
  • Loading branch information
VincentLanglet authored Dec 7, 2024
1 parent 817a6b7 commit f7aed13
Show file tree
Hide file tree
Showing 21 changed files with 40 additions and 37 deletions.
2 changes: 1 addition & 1 deletion src/Block/BlockContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ final class BlockContext implements BlockContextInterface
* @param array<string, mixed> $settings
*/
public function __construct(
private readonly BlockInterface $block,
private BlockInterface $block,
private array $settings = [],
) {
}
Expand Down
7 changes: 5 additions & 2 deletions src/Block/BlockContextManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,11 @@ final class BlockContextManager implements BlockContextManagerInterface
*/
private array $settingsByClass = [];

public function __construct(private readonly BlockLoaderInterface $blockLoader, private readonly BlockServiceManagerInterface $blockService, private readonly LoggerInterface $logger = new NullLogger())
{
public function __construct(
private BlockLoaderInterface $blockLoader,
private BlockServiceManagerInterface $blockService,
private LoggerInterface $logger = new NullLogger(),
) {
}

public function addSettingsByType(string $type, array $settings, bool $replace = false): void
Expand Down
2 changes: 1 addition & 1 deletion src/Block/BlockLoaderChain.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ final class BlockLoaderChain implements BlockLoaderInterface
/**
* @param BlockLoaderInterface[] $loaders
*/
public function __construct(private readonly array $loaders)
public function __construct(private array $loaders)
{
}

Expand Down
6 changes: 3 additions & 3 deletions src/Block/BlockRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
final class BlockRenderer implements BlockRendererInterface
{
public function __construct(
private readonly BlockServiceManagerInterface $blockServiceManager,
private readonly StrategyManagerInterface $exceptionStrategyManager,
private readonly ?LoggerInterface $logger = null,
private BlockServiceManagerInterface $blockServiceManager,
private StrategyManagerInterface $exceptionStrategyManager,
private ?LoggerInterface $logger = null,
) {
}

Expand Down
4 changes: 2 additions & 2 deletions src/Block/BlockServiceManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ final class BlockServiceManager implements BlockServiceManagerInterface
* @param string[] $containerTypes
*/
public function __construct(
private readonly ContainerInterface $container,
private readonly array $containerTypes,
private ContainerInterface $container,
private array $containerTypes,
) {
}

Expand Down
2 changes: 1 addition & 1 deletion src/Block/Loader/ServiceLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ final class ServiceLoader implements BlockLoaderInterface
/**
* @param string[] $types
*/
public function __construct(private readonly array $types)
public function __construct(private array $types)
{
}

Expand Down
2 changes: 1 addition & 1 deletion src/Block/Service/AbstractBlockService.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*/
abstract class AbstractBlockService implements BlockServiceInterface
{
public function __construct(private readonly Environment $twig)
public function __construct(private Environment $twig)
{
}

Expand Down
4 changes: 2 additions & 2 deletions src/Block/Service/MenuBlockService.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ final class MenuBlockService extends AbstractMenuBlockService
{
public function __construct(
Environment $twig,
private readonly MenuProviderInterface $menuProvider,
private readonly MenuRegistryInterface $menuRegistry,
private MenuProviderInterface $menuProvider,
private MenuRegistryInterface $menuRegistry,
) {
parent::__construct($twig);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Command/DebugBlocksCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#[AsCommand(name: 'debug:sonata:block', description: 'Debug all blocks available, show default settings of each block')]
final class DebugBlocksCommand extends Command
{
public function __construct(private readonly BlockServiceManagerInterface $blockManager)
public function __construct(private BlockServiceManagerInterface $blockManager)
{
parent::__construct();
}
Expand Down
2 changes: 1 addition & 1 deletion src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ final class Configuration implements ConfigurationInterface
/**
* @param array<string, string> $defaultContainerTemplates
*/
public function __construct(private readonly array $defaultContainerTemplates)
public function __construct(private array $defaultContainerTemplates)
{
}

Expand Down
2 changes: 1 addition & 1 deletion src/Exception/Filter/DebugOnlyFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*/
final class DebugOnlyFilter implements FilterInterface
{
public function __construct(private readonly bool $debug)
public function __construct(private bool $debug)
{
}

Expand Down
2 changes: 1 addition & 1 deletion src/Exception/Filter/IgnoreClassFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*/
final class IgnoreClassFilter implements FilterInterface
{
public function __construct(private readonly string $class)
public function __construct(private string $class)
{
}

Expand Down
8 changes: 4 additions & 4 deletions src/Exception/Renderer/InlineDebugRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
final class InlineDebugRenderer implements RendererInterface
{
public function __construct(
private readonly Environment $twig,
private readonly string $template,
private readonly bool $debug,
private readonly bool $forceStyle = true,
private Environment $twig,
private string $template,
private bool $debug,
private bool $forceStyle = true,
) {
}

Expand Down
4 changes: 2 additions & 2 deletions src/Exception/Renderer/InlineRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
final class InlineRenderer implements RendererInterface
{
public function __construct(
private readonly Environment $twig,
private readonly string $template,
private Environment $twig,
private string $template,
) {
}

Expand Down
2 changes: 1 addition & 1 deletion src/Exception/Strategy/StrategyManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ final class StrategyManager implements StrategyManagerInterface
* @param array<string, string> $blockRenderers Renderer names for each block
*/
public function __construct(
private readonly ContainerInterface $container,
private ContainerInterface $container,
private array $filters,
private array $renderers,
private array $blockFilters,
Expand Down
2 changes: 1 addition & 1 deletion src/Form/Type/ContainerTemplateType.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ final class ContainerTemplateType extends AbstractType
/**
* @param array<string, string> $templateChoices
*/
public function __construct(private readonly array $templateChoices)
public function __construct(private array $templateChoices)
{
}

Expand Down
2 changes: 1 addition & 1 deletion src/Form/Type/ServiceListType.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
*/
final class ServiceListType extends AbstractType
{
public function __construct(private readonly BlockServiceManagerInterface $manager)
public function __construct(private BlockServiceManagerInterface $manager)
{
}

Expand Down
8 changes: 4 additions & 4 deletions src/Meta/Metadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ final class Metadata implements MetadataInterface
* @param array<string, mixed> $options
*/
public function __construct(
private readonly string $title,
private readonly ?string $description = null,
private readonly ?string $image = null,
private readonly ?string $domain = null,
private string $title,
private ?string $description = null,
private ?string $image = null,
private ?string $domain = null,
private array $options = [],
) {
}
Expand Down
4 changes: 2 additions & 2 deletions src/Profiler/DataCollector/BlockDataCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ final class BlockDataCollector extends DataCollector
* @param string[] $containerTypes array of container types
*/
public function __construct(
private readonly BlockHelper $blocksHelper,
private readonly array $containerTypes,
private BlockHelper $blocksHelper,
private array $containerTypes,
) {
$this->reset();
}
Expand Down
8 changes: 4 additions & 4 deletions src/Templating/Helper/BlockHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ class BlockHelper
* @internal
*/
public function __construct(
private readonly BlockRendererInterface $blockRenderer,
private readonly BlockContextManagerInterface $blockContextManager,
private readonly EventDispatcherInterface $eventDispatcher,
private readonly ?Stopwatch $stopwatch = null,
private BlockRendererInterface $blockRenderer,
private BlockContextManagerInterface $blockContextManager,
private EventDispatcherInterface $eventDispatcher,
private ?Stopwatch $stopwatch = null,
) {
}

Expand Down
2 changes: 1 addition & 1 deletion src/Twig/GlobalVariables.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ final class GlobalVariables
/**
* @param string[] $templates
*/
public function __construct(private readonly array $templates)
public function __construct(private array $templates)
{
}

Expand Down

0 comments on commit f7aed13

Please sign in to comment.