Skip to content

Commit

Permalink
Make promoted property readonly by default
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Jan 5, 2025
1 parent 29a1abf commit f7e0a14
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;

final class CommandGetWithType extends ContainerAwareCommand
{
public function __construct(private \Rector\Symfony\Tests\DependencyInjection\Rector\Class_\CommandGetByTypeToConstructorInjectionRector\Fixture\SomeService $someService)
public function __construct(private readonly \Rector\Symfony\Tests\DependencyInjection\Rector\Class_\CommandGetByTypeToConstructorInjectionRector\Fixture\SomeService $someService)
{
parent::__construct();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ final class IncludeConstructorCommandGetWithType extends ContainerAwareCommand
{
private string $value;

public function __construct(private \Rector\Symfony\Tests\DependencyInjection\Rector\Class_\CommandGetByTypeToConstructorInjectionRector\Fixture\SomeService $someService)
public function __construct(private readonly \Rector\Symfony\Tests\DependencyInjection\Rector\Class_\CommandGetByTypeToConstructorInjectionRector\Fixture\SomeService $someService)
{
$this->value = 'some';
parent::__construct();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;

final class IncludeGetContainer extends ContainerAwareCommand
{
public function __construct(private \Rector\Symfony\Tests\DependencyInjection\Rector\Class_\CommandGetByTypeToConstructorInjectionRector\Fixture\SomeService $someService)
public function __construct(private readonly \Rector\Symfony\Tests\DependencyInjection\Rector\Class_\CommandGetByTypeToConstructorInjectionRector\Fixture\SomeService $someService)
{
parent::__construct();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\Controller;

final class ControllerGetWithType extends Controller
{
public function __construct(private \Rector\Symfony\Tests\DependencyInjection\Rector\Class_\ControllerGetByTypeToConstructorInjectionRector\Source\SomeService $someService)
public function __construct(private readonly \Rector\Symfony\Tests\DependencyInjection\Rector\Class_\ControllerGetByTypeToConstructorInjectionRector\Source\SomeService $someService)
{
}
public function configure()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\Controller;

final class CoverContainerProperty extends Controller
{
public function __construct(private \Rector\Symfony\Tests\DependencyInjection\Rector\Class_\ControllerGetByTypeToConstructorInjectionRector\Source\SomeService $someService)
public function __construct(private readonly \Rector\Symfony\Tests\DependencyInjection\Rector\Class_\ControllerGetByTypeToConstructorInjectionRector\Source\SomeService $someService)
{
}
public function configure()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;

final class CommandValidator extends ContainerAwareCommand
{
public function __construct(private \Symfony\Component\Validator\Validator\ValidatorInterface $validator)
public function __construct(private readonly \Symfony\Component\Validator\Validator\ValidatorInterface $validator)
{
}
public function configure()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\Controller;

final class EventDispatcherController extends Controller
{
public function __construct(private \Symfony\Contracts\EventDispatcher\EventDispatcherInterface $eventDispatcher)
public function __construct(private readonly \Symfony\Contracts\EventDispatcher\EventDispatcherInterface $eventDispatcher)
{
}
public function configure()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\Controller;

class ClassWithNamedService extends Controller
{
public function __construct(private \stdClass $stdClass)
public function __construct(private readonly \stdClass $stdClass)
{
}
public function render()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\Controller;

final class ClassWithNamedService2 extends Controller
{
public function __construct(private \Rector\Symfony\Tests\Symfony28\Rector\MethodCall\GetToConstructorInjectionRector\Source\Something $something, private \Rector\Symfony\Tests\Symfony28\Rector\MethodCall\GetToConstructorInjectionRector\Source\Anything $anything)
public function __construct(private readonly \Rector\Symfony\Tests\Symfony28\Rector\MethodCall\GetToConstructorInjectionRector\Source\Something $something, private readonly \Rector\Symfony\Tests\Symfony28\Rector\MethodCall\GetToConstructorInjectionRector\Source\Anything $anything)
{
}
public function render()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;

final class DispatchMessage extends AbstractController
{
public function __construct(private \Symfony\Component\Messenger\MessageBusInterface $messageBus)
public function __construct(private readonly \Symfony\Component\Messenger\MessageBusInterface $messageBus)
{
}
public function run()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;

final class SomeController extends AbstractController
{
public function __construct(private \Doctrine\Persistence\ManagerRegistry $managerRegistry)
public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry)
{
}
public function run()
Expand Down

0 comments on commit f7e0a14

Please sign in to comment.