Skip to content

Commit 0803109

Browse files
Add additional readonly modifiers
1 parent 44cab16 commit 0803109

File tree

5 files changed

+16
-16
lines changed

5 files changed

+16
-16
lines changed

src/Event/BoltFormsEvent.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
class BoltFormsEvent extends FormEvent
3535
{
3636
public function __construct(
37-
protected FormEvent $event,
38-
protected string $formsEventName
37+
protected readonly FormEvent $event,
38+
protected readonly string $formsEventName
3939
) {
4040
parent::__construct($event->getForm(), $event->getData());
4141
}

src/EventSubscriber/FileUploadHandler.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
use Symfony\Component\Form\FormInterface;
1717
use Symfony\Component\HttpFoundation\File\UploadedFile;
1818

19-
class FileUploadHandler implements EventSubscriberInterface
19+
readonly class FileUploadHandler implements EventSubscriberInterface
2020
{
2121
public function __construct(
22-
private readonly FormHelper $helper,
23-
private readonly string $projectDir = '',
22+
private FormHelper $helper,
23+
private string $projectDir = '',
2424
) {
2525
}
2626

src/EventSubscriber/HoneypotSubscriber.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
1010
use Symfony\Component\Form\FormError;
1111

12-
class HoneypotSubscriber implements EventSubscriberInterface
12+
readonly class HoneypotSubscriber implements EventSubscriberInterface
1313
{
1414
public function handleEvent(PostSubmitEvent $event): PostSubmitEvent
1515
{

src/EventSubscriber/SymfonyFormProxySubscriber.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@
3535
* @license http://opensource.org/licenses/GPL-3.0 GNU Public License 3.0
3636
* @license http://opensource.org/licenses/LGPL-3.0 GNU Lesser General Public License 3.0
3737
*/
38-
class SymfonyFormProxySubscriber implements EventSubscriberInterface
38+
readonly class SymfonyFormProxySubscriber implements EventSubscriberInterface
3939
{
4040
public function __construct(
41-
private readonly EventDispatcherInterface $boltFormsDispatcher
41+
private EventDispatcherInterface $boltFormsDispatcher
4242
) {
4343
}
4444

src/FormRuntime.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@
1212
use Twig\Environment;
1313
use Twig\Extension\RuntimeExtensionInterface;
1414

15-
class FormRuntime implements RuntimeExtensionInterface
15+
readonly class FormRuntime implements RuntimeExtensionInterface
1616
{
1717
public function __construct(
18-
private readonly Notifications $notifications,
19-
private readonly Environment $twig,
20-
private readonly FormBuilder $builder,
21-
private readonly RequestStack $requestStack,
22-
private readonly EventDispatcherInterface $dispatcher,
23-
private readonly BoltFormsConfig $config,
24-
private readonly PostSubmitEventDispatcher $postSubmitEventDispatcher
18+
private Notifications $notifications,
19+
private Environment $twig,
20+
private FormBuilder $builder,
21+
private RequestStack $requestStack,
22+
private EventDispatcherInterface $dispatcher,
23+
private BoltFormsConfig $config,
24+
private PostSubmitEventDispatcher $postSubmitEventDispatcher
2525
) {
2626
}
2727

0 commit comments

Comments
 (0)