Skip to content

Commit bc513eb

Browse files
committed
Remove unnecessary type hints
1 parent e7ac588 commit bc513eb

File tree

5 files changed

+0
-35
lines changed

5 files changed

+0
-35
lines changed

application/controllers/EventRuleController.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@ public function indexAction(): void
5050
$this->addTitleTab(t('Event Rule'));
5151
$this->controls->addAttributes(['class' => 'event-rule-detail']);
5252

53-
/** @var string $ruleId */
5453
$ruleId = $this->params->getRequired('id');
55-
/** @var array<string, mixed>|null $configValues */
5654
$configValues = $this->sessionNamespace->get($ruleId);
5755
$this->controls->addAttributes(['class' => 'event-rule-detail']);
5856

@@ -98,7 +96,6 @@ public function indexAction(): void
9896
})
9997
->handleRequest($this->getServerRequest());
10098

101-
/** @var array<string, mixed> $cache */
10299
$cache = $this->sessionNamespace->get($ruleId);
103100
$discardChangesButton = null;
104101
if ($cache !== null) {
@@ -187,7 +184,6 @@ public function fromDb(int $ruleId): array
187184
foreach ($rule->rule_escalation as $re) {
188185
foreach ($re as $k => $v) {
189186
if (in_array($k, ['id', 'condition'])) {
190-
/** @var int|string|null $v */
191187
$config[$re->getTableName()][$re->position][$k] = (string) $v;
192188
}
193189
}
@@ -244,7 +240,6 @@ public function searchEditorAction(): void
244240

245241
$editor = new SearchEditor();
246242

247-
/** @var string $objectFilter */
248243
$objectFilter = $eventRule['object_filter'] ?? '';
249244
$editor->setQueryString($objectFilter)
250245
->setAction(Url::fromRequest()->getAbsoluteUrl())
@@ -295,7 +290,6 @@ public function editAction(): void
295290
{
296291
/** @var string $ruleId */
297292
$ruleId = $this->params->getRequired('id');
298-
/** @var array<string, mixed>|null $config */
299293
$config = $this->sessionNamespace->get($ruleId);
300294
if ($config === null) {
301295
if ($ruleId === '-1') {

application/controllers/EventRulesController.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,12 @@ public function addAction(): void
108108
$this->getTabs()->setRefreshUrl(Url::fromPath('notifications/event-rules/add'));
109109

110110
$this->controls->addAttributes(['class' => 'event-rule-detail']);
111-
/** @var string $ruleId */
112111
$ruleId = $this->params->get('id') ?? '-1';
113112

114113
$params = $this->params->toArray(false);
115-
/** @var array<string, mixed>|null $config */
116114
$config = $this->sessionNamespace->get($ruleId);
117115

118116
if ($config === null) {
119-
/** @var array<string, mixed> $config */
120117
$config = $params;
121118
}
122119

@@ -140,9 +137,7 @@ public function addAction(): void
140137

141138
$eventRuleConfig
142139
->on(Form::ON_SUCCESS, function (EventRuleConfigForm $form) use ($config) {
143-
/** @var string $ruleId */
144140
$ruleId = $config['id'];
145-
/** @var string $ruleName */
146141
$ruleName = $config['name'];
147142
$form->addOrUpdateRule($ruleId, $config);
148143
$this->sessionNamespace->delete($ruleId);
@@ -174,10 +169,7 @@ public function addAction(): void
174169

175170
public function searchEditorAction(): void
176171
{
177-
/** @var string $ruleId */
178172
$ruleId = $this->params->shiftRequired('id');
179-
180-
/** @var array<string, mixed>|null $eventRule */
181173
$eventRule = $this->sessionNamespace->get($ruleId);
182174

183175
if ($eventRule === null) {
@@ -186,7 +178,6 @@ public function searchEditorAction(): void
186178

187179
$editor = new SearchEditor();
188180

189-
/** @var string $objectFilter */
190181
$objectFilter = $eventRule['object_filter'] ?? '';
191182
$editor->setQueryString($objectFilter)
192183
->setAction(Url::fromRequest()->getAbsoluteUrl())

application/forms/EventRuleConfigElements/EscalationCondition.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ protected function assemble(): void
5151
['value' => (string) $defaultCount]
5252
);
5353

54-
/** @var SubmitButtonElement $addCondition */
5554
$addCondition = $this->createElement(
5655
'submitButton',
5756
'add-condition',
@@ -65,7 +64,6 @@ protected function assemble(): void
6564

6665
$this->registerElement($addCondition);
6766

68-
/** @var string|int $conditionCount */
6967
$conditionCount = $this->getValue('condition-count');
7068
$conditionCount = (int) $conditionCount;
7169
$this->addElement('hidden', 'id');
@@ -240,7 +238,6 @@ protected function assemble(): void
240238
protected function createRemoveButton(int $count): ?SubmitButtonElement
241239
{
242240
// check for count and if allow zero conditions
243-
/** @var string|int $conditionCount */
244241
$conditionCount = $this->getValue('condition-count');
245242
if ((int) $conditionCount === 1 && ! $this->allowZeroConditions) {
246243
return null;

application/forms/EventRuleConfigElements/EscalationRecipient.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ protected function assemble(): void
2424
{
2525
$this->addElement('hidden', 'recipient-count', ['value' => '1']);
2626

27-
/** @var SubmitButtonElement $addRecipientButton */
2827
$addRecipientButton = $this->createElement(
2928
'submitButton',
3029
'add-recipient',
@@ -37,7 +36,6 @@ protected function assemble(): void
3736
);
3837

3938
$this->registerElement($addRecipientButton);
40-
/** @var int $recipientCount */
4139
$recipientCount = $this->getValue('recipient-count');
4240
if ($addRecipientButton->hasBeenPressed()) {
4341
$recipientCount += 1;
@@ -66,7 +64,6 @@ protected function assemble(): void
6664
$options = ['' => sprintf(' - %s - ', $this->translate('Please choose'))];
6765
$options += Channel::fetchChannelNames(Database::get());
6866

69-
/** @var SelectElement $val */
7067
$val = $this->createElement(
7168
'select',
7269
'val_' . $i,
@@ -78,7 +75,6 @@ protected function assemble(): void
7875
]
7976
);
8077

81-
/** @var string $recipientVal */
8278
$recipientVal = $this->getValue('column_' . $i);
8379
if ($recipientVal !== null) {
8480
$recipient = explode('_', $recipientVal);
@@ -169,7 +165,6 @@ protected function fetchOptions(): array
169165
*/
170166
protected function createRemoveButton(int $pos): ?SubmitButtonElement
171167
{
172-
/** @var string|int $recipientCount */
173168
$recipientCount = $this->getValue('recipient-count');
174169
if ((int) $recipientCount === 1) {
175170
return null;
@@ -207,7 +202,6 @@ public function getRecipients(): array
207202
/** @var int $count */
208203
$count = $this->getValue('recipient-count');
209204

210-
/** @var array<int, array<string, mixed>> $values */
211205
$values = [];
212206
for ($i = 1; $i <= $count; $i++) {
213207
$value = [];

application/forms/EventRuleConfigForm.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ protected function assemble(): void
125125
]
126126
);
127127

128-
/** @var string $ruleId */
129128
$ruleId = $this->config['id'];
130129
if ($ruleId === '-1') {
131130
$initialZeroConditionEscalation = bin2hex('1');
@@ -139,7 +138,6 @@ protected function assemble(): void
139138
['value' => $initialZeroConditionEscalation]
140139
);
141140

142-
/** @var string $objectFilter */
143141
$objectFilter = $this->config['object_filter'] ?? '';
144142
$configFilter = (new EventRuleConfigFilter('config-filter'))
145143
->setObjectFilter($objectFilter)
@@ -168,10 +166,8 @@ protected function assemble(): void
168166
$this->addElement($prefixesElement);
169167
$this->handleAdd();
170168

171-
/** @var string $prefixesMapString */
172169
$prefixesMapString = $prefixesElement->getValue();
173170

174-
/** @var array<int, string> $prefixesMap */
175171
$prefixesMap = explode(',', $prefixesMapString);
176172
$escalationCount = count($prefixesMap);
177173

@@ -183,15 +179,13 @@ protected function assemble(): void
183179
$removeEscalationButtons[$prefixMap] = $this->createRemoveButton($prefixMap);
184180
}
185181

186-
/** @var ?string $removePosition */
187182
$removePosition = $this->getValue('remove-escalation');
188183
if ($removePosition) {
189184
if ($escalationCount === 2) {
190185
$removeEscalationButtons = [];
191186
}
192187
}
193188

194-
/** @var ?string $zeroConditionEscalation */
195189
$zeroConditionEscalation = $this->getValue('zero-condition-escalation');
196190

197191
$escalations = [];
@@ -279,7 +273,6 @@ protected function handleAdd(): void
279273

280274
if ($pressedButton && $pressedButton->getName() === 'add-escalation') {
281275
$this->clearPopulatedValue('prefixes-map');
282-
/** @var string $prefixesMapString */
283276
$prefixesMapString = $this->getValue('prefixes-map');
284277
$prefixesMap = explode(',', $prefixesMapString);
285278
$escalationFakePos = bin2hex(random_bytes(4));
@@ -497,7 +490,6 @@ public function addOrUpdateRule(string $id, array $config): void
497490
$escalationsFromDb = RuleEscalation::on($db)
498491
->filter(Filter::equal('rule_id', $id));
499492

500-
/** @var array<int, array<string, mixed>> $escalationsInCache */
501493
$escalationsInCache = $config['rule_escalation'];
502494

503495
$escalationsToUpdate = [];
@@ -558,7 +550,6 @@ private function insertOrUpdateEscalations(
558550
bool $insert = false
559551
): void {
560552
foreach ($escalations as $position => $escalationConfig) {
561-
/** @var array<int, array<string, mixed>> $recipientsFromConfig */
562553
$recipientsFromConfig = $escalationConfig['recipients'] ?? [];
563554
if ($insert) {
564555
$db->insert('rule_escalation', [
@@ -569,7 +560,6 @@ private function insertOrUpdateEscalations(
569560
'fallback_for' => $escalationConfig['fallback_for'] ?? null
570561
]);
571562

572-
/** @var string $escalationId */
573563
$escalationId = $db->lastInsertId();
574564
} else {
575565
/** @var string $escalationId */
@@ -609,7 +599,6 @@ function (array $element) use ($recipientId) {
609599
}
610600
}
611601

612-
/** @var array<string, mixed> $recipientConfig */
613602
foreach ($recipientsFromConfig as $recipientConfig) {
614603
$data = [
615604
'rule_escalation_id' => $escalationId,

0 commit comments

Comments
 (0)