Skip to content

Commit d69857c

Browse files
committed
Update: Flow Annotations
1 parent 41c4686 commit d69857c

24 files changed

+121
-310
lines changed

Classes/Command/MauticCommandController.php

+5-15
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,14 @@
88
use Neos\Flow\Cli\CommandController;
99
use function \Neos\Flow\var_dump;
1010

11-
/**
12-
*
13-
* @Flow\Scope("singleton")
14-
*/
11+
#[Flow\Scope('singleton')]
1512
class MauticCommandController extends CommandController
1613
{
14+
#[Flow\Inject]
15+
protected ApiService $apiService;
1716

18-
/**
19-
* @Flow\Inject
20-
* @var ApiService
21-
*/
22-
protected $apiService;
23-
24-
/**
25-
* @Flow\Inject
26-
* @var MauticService
27-
*/
28-
protected $mauticService;
17+
#[Flow\Inject]
18+
protected MauticService $mauticService;
2919

3020
public function getCommand(string $emailIdentifier)
3121
{

Classes/Controller/BackendController.php

+23-61
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@
2525
use Neos\Neos\Service\UserService;
2626
use Neos\Neos\TypeConverter\NodeConverter;
2727

28-
/**
29-
* @Flow\Scope("singleton")
30-
*/
28+
#[Flow\Scope('singleton')]
3129
class BackendController extends AbstractModuleController
3230
{
3331
/**
@@ -40,76 +38,40 @@ class BackendController extends AbstractModuleController
4038
*/
4139
protected $defaultViewObjectName = FusionView::class;
4240

43-
/**
44-
* @Flow\Inject
45-
* @var Context
46-
*/
47-
protected $securityContext;
41+
#[Flow\Inject]
42+
protected Context $securityContext;
4843

49-
/**
50-
* @Flow\Inject
51-
* @var NodeService
52-
*/
53-
protected $nodeService;
44+
#[Flow\Inject]
45+
protected NodeService $nodeService;
5446

55-
/**
56-
* @Flow\Inject
57-
* @var LinkingService
58-
*/
59-
protected $linkingService;
47+
#[Flow\Inject]
48+
protected LinkingService $linkingService;
6049

61-
/**
62-
* @Flow\Inject
63-
* @var MauticService
64-
*/
65-
protected $mauticService;
50+
#[Flow\Inject]
51+
protected MauticService $mauticService;
6652

67-
/**
68-
* @Flow\Inject
69-
* @var TaskService
70-
*/
71-
protected $taskService;
53+
#[Flow\Inject]
54+
protected TaskService $taskService;
7255

73-
/**
74-
* @Flow\Inject
75-
* @var TestEmailService
76-
*/
77-
protected $testEmailService;
56+
#[Flow\Inject]
57+
protected TestEmailService $testEmailService;
7858

79-
/**
80-
* @Flow\Inject
81-
* @var ApiService
82-
*/
83-
protected $apiService;
59+
#[Flow\Inject]
60+
protected ApiService $apiService;
8461

85-
/**
86-
* @Flow\Inject
87-
* @var FlashMessageService
88-
*/
89-
protected $flashMessageService;
62+
#[Flow\Inject]
63+
protected FlashMessageService $flashMessageService;
9064

91-
/**
92-
* @Flow\Inject
93-
* @var TranslationHelper
94-
*/
95-
protected $translationHelper;
65+
#[Flow\Inject]
66+
protected TranslationHelper $translationHelper;
9667

97-
/**
98-
* @Flow\Inject
99-
* @var UserService
100-
*/
101-
protected $userService;
68+
#[Flow\Inject]
69+
protected UserService $userService;
10270

103-
/**
104-
* @var array
105-
* @Flow\InjectConfiguration(path="routeArgument", package="Garagist.Mautic")
106-
*/
71+
#[Flow\InjectConfiguration('routeArgument', 'Garagist.Mautic')]
10772
protected $routeArgument;
10873

109-
/**
110-
* @var string
111-
* @Flow\InjectConfiguration(path="mail.trackingPixel", package="Garagist.Mautic")
112-
*/
74+
#[Flow\InjectConfiguration('mail.trackingPixel', 'Garagist.Mautic')]
11375
protected $trackingPixel;
11476

11577
/**

Classes/DataSource/FormsDataSource.php

+2-5
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,8 @@ class FormsDataSource extends AbstractDataSource
1414
*/
1515
protected static $identifier = 'garagist-mautic-forms';
1616

17-
/**
18-
* @Flow\Inject
19-
* @var ApiService
20-
*/
21-
protected $apiService;
17+
#[Flow\Inject]
18+
protected ApiService $apiService;
2219

2320
/**
2421
* Get data

Classes/Domain/Model/MauticEmail.php

+1-4
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@
66
use Doctrine\ORM\Mapping as ORM;
77
use DateTime;
88

9-
/**
10-
*
11-
* @Flow\Entity
12-
*/
9+
#[Flow\Entity]
1310
class MauticEmail
1411
{
1512

Classes/Domain/Repository/MauticEmailRepository.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
use Neos\Flow\Annotations as Flow;
66
use Neos\Flow\Persistence\Doctrine\Repository;
77

8-
/**
9-
* @Flow\Scope("singleton")
10-
*/
8+
#[Flow\Scope('singleton')]
119
class MauticEmailRepository extends Repository
1210
{
1311
}

Classes/Event/MauticEmailCreate.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88
use Doctrine\ORM\Mapping as ORM;
99
use Neos\Flow\Annotations as Flow;
1010

11-
/**
12-
* @Flow\Proxy(false)
13-
*/
11+
#[Flow\Proxy(false)]
1412
class MauticEmailCreate implements DomainEventInterface
1513
{
1614
/**

Classes/Event/MauticEmailDelete.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77
use Neos\EventSourcing\Event\DomainEventInterface;
88
use Neos\Flow\Annotations as Flow;
99

10-
/**
11-
* @Flow\Proxy(false)
12-
*/
10+
#[Flow\Proxy(false)]
1311
final class MauticEmailDelete implements DomainEventInterface
1412
{
1513
/**

Classes/Event/MauticEmailPublish.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77
use Neos\EventSourcing\Event\DomainEventInterface;
88
use Neos\Flow\Annotations as Flow;
99

10-
/**
11-
* @Flow\Proxy(false)
12-
*/
10+
#[Flow\Proxy(false)]
1311
final class MauticEmailPublish implements DomainEventInterface
1412
{
1513
/**

Classes/Event/MauticEmailSend.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77
use Neos\EventSourcing\Event\DomainEventInterface;
88
use Neos\Flow\Annotations as Flow;
99

10-
/**
11-
* @Flow\Proxy(false)
12-
*/
10+
#[Flow\Proxy(false)]
1311
final class MauticEmailSend implements DomainEventInterface
1412
{
1513
/**

Classes/Event/MauticEmailSent.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77
use Neos\EventSourcing\Event\DomainEventInterface;
88
use Neos\Flow\Annotations as Flow;
99

10-
/**
11-
* @Flow\Proxy(false)
12-
*/
10+
#[Flow\Proxy(false)]
1311
final class MauticEmailSent implements DomainEventInterface
1412
{
1513
/**

Classes/Event/MauticEmailSync.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77
use Neos\EventSourcing\Event\DomainEventInterface;
88
use Neos\Flow\Annotations as Flow;
99

10-
/**
11-
* @Flow\Proxy(false)
12-
*/
10+
#[Flow\Proxy(false)]
1311
final class MauticEmailSync implements DomainEventInterface
1412
{
1513
/**

Classes/Event/MauticEmailTaskFinished.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77
use Neos\EventSourcing\Event\DomainEventInterface;
88
use Neos\Flow\Annotations as Flow;
99

10-
/**
11-
* @Flow\Proxy(false)
12-
*/
10+
#[Flow\Proxy(false)]
1311
final class MauticEmailTaskFinished implements DomainEventInterface
1412
{
1513
/**

Classes/Event/MauticEmailUnpublish.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77
use Neos\EventSourcing\Event\DomainEventInterface;
88
use Neos\Flow\Annotations as Flow;
99

10-
/**
11-
* @Flow\Proxy(false)
12-
*/
10+
#[Flow\Proxy(false)]
1311
final class MauticEmailUnpublish implements DomainEventInterface
1412
{
1513
/**

Classes/Event/MauticEmailUpdate.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88
use Doctrine\ORM\Mapping as ORM;
99
use Neos\Flow\Annotations as Flow;
1010

11-
/**
12-
* @Flow\Proxy(false)
13-
*/
11+
#[Flow\Proxy(false)]
1412
class MauticEmailUpdate implements DomainEventInterface
1513
{
1614
/**

Classes/FusionObjects/ApiFormImplementation.php

+5-8
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,8 @@
99
class ApiFormImplementation extends AbstractFusionObject
1010
{
1111

12-
/**
13-
* @Flow\Inject
14-
* @var ApiService
15-
*/
16-
protected $apiService;
12+
#[Flow\Inject]
13+
protected ApiService $apiService;
1714

1815
/**
1916
* @return string
@@ -60,12 +57,12 @@ public function evaluate()
6057
$tagName = null;
6158
if (in_array($type, ['email', 'password', 'text', 'file', 'date', 'datetime', 'number', 'captcha', 'url', 'tel'])) {
6259
$tagName = 'input';
63-
} else if (in_array($type, ['select', 'country'])) {
60+
} elseif (in_array($type, ['select', 'country'])) {
6461
$tagName = 'select';
65-
} else if (in_array($type, ['radiogrp', 'checkboxgrp'])) {
62+
} elseif (in_array($type, ['radiogrp', 'checkboxgrp'])) {
6663
$tagName = 'inputGroup';
6764
$value = $value ? array_map('trim', explode(',', $value)) : [];
68-
} else if ($type == 'textarea') {
65+
} elseif ($type == 'textarea') {
6966
$tagName = $type;
7067
}
7168

Classes/FusionObjects/PersonalizationImplementation.php

+2-6
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,8 @@
88

99
class PersonalizationImplementation extends AbstractFusionObject
1010
{
11-
12-
/**
13-
* @Flow\Inject
14-
* @var PersonalizationService
15-
*/
16-
protected $personalizationService;
11+
#[Flow\Inject]
12+
protected PersonalizationService $personalizationService;
1713

1814
/**
1915
* @return string

Classes/Manager/MauticProcessManager.php

+10-24
Original file line numberDiff line numberDiff line change
@@ -24,34 +24,20 @@
2424

2525
final class MauticProcessManager implements EventListenerInterface
2626
{
27-
/**
28-
* @Flow\Inject
29-
* @var MauticService
30-
*/
31-
protected $mauticService;
27+
#[Flow\Inject]
28+
protected MauticService $mauticService;
3229

33-
/**
34-
* @Flow\Inject
35-
* @var TaskService
36-
*/
37-
protected $taskService;
30+
#[Flow\Inject]
31+
protected TaskService $taskService;
3832

39-
/**
40-
* @var EventStore
41-
*/
42-
protected $eventStore;
33+
#[Flow\Inject]
34+
protected EventStore $eventStore;
4335

44-
/**
45-
* @Flow\Inject
46-
* @var EventStoreFactory
47-
*/
48-
protected $eventStoreFactory;
36+
#[Flow\Inject]
37+
protected EventStoreFactory $eventStoreFactory;
4938

50-
/**
51-
* @Flow\Inject(name="Garagist.Mautic:MauticLogger")
52-
* @var LoggerInterface
53-
*/
54-
protected $mauticLogger;
39+
#[Flow\Inject(name: 'Garagist.Mautic:MauticLogger')]
40+
protected LoggerInterface $mauticLogger;
5541

5642
protected function initializeObject(): void
5743
{

0 commit comments

Comments
 (0)