Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions application/controllers/ChannelController.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php

Check failure on line 1 in application/controllers/ChannelController.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 7.2 on ubuntu-latest

Ignored error pattern #^Cannot access property \$name on ipl\\Orm\\Model\|null\.$# in path /home/runner/work/icinga-notifications-web/icinga-notifications-web/application/controllers/ChannelController.php was not matched in reported errors.

Check failure on line 1 in application/controllers/ChannelController.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 7.2 on ubuntu-latest

Ignored error pattern #^Method Icinga\\Module\\Notifications\\Controllers\\ChannelController\:\:indexAction\(\) has no return type specified\.$# in path /home/runner/work/icinga-notifications-web/icinga-notifications-web/application/controllers/ChannelController.php was not matched in reported errors.

Check failure on line 1 in application/controllers/ChannelController.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 7.2 on ubuntu-latest

Ignored error pattern #^Parameter \#1 \$values of method Icinga\\Module\\Notifications\\Forms\\ChannelForm\:\:populate\(\) expects iterable\<string, mixed\>, ipl\\Orm\\Model\|null given\.$# in path /home/runner/work/icinga-notifications-web/icinga-notifications-web/application/controllers/ChannelController.php was not matched in reported errors.

Check failure on line 1 in application/controllers/ChannelController.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 7.2 on ubuntu-latest

Ignored error pattern #^Parameter \#2 \$channelId of class Icinga\\Module\\Notifications\\Forms\\ChannelForm constructor expects int\|null, mixed given\.$# in path /home/runner/work/icinga-notifications-web/icinga-notifications-web/application/controllers/ChannelController.php was not matched in reported errors.

Check failure on line 1 in application/controllers/ChannelController.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 7.2 on ubuntu-latest

Ignored error pattern #^Parameter \#2 \$value of static method ipl\\Stdlib\\Filter\:\:equal\(\) expects array\|bool\|float\|int\|string, mixed given\.$# in path /home/runner/work/icinga-notifications-web/icinga-notifications-web/application/controllers/ChannelController.php was not matched in reported errors.

Check failure on line 1 in application/controllers/ChannelController.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 7.3 on ubuntu-latest

Ignored error pattern #^Cannot access property \$name on ipl\\Orm\\Model\|null\.$# in path /home/runner/work/icinga-notifications-web/icinga-notifications-web/application/controllers/ChannelController.php was not matched in reported errors.

Check failure on line 1 in application/controllers/ChannelController.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 7.3 on ubuntu-latest

Ignored error pattern #^Method Icinga\\Module\\Notifications\\Controllers\\ChannelController\:\:indexAction\(\) has no return type specified\.$# in path /home/runner/work/icinga-notifications-web/icinga-notifications-web/application/controllers/ChannelController.php was not matched in reported errors.

Check failure on line 1 in application/controllers/ChannelController.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 7.3 on ubuntu-latest

Ignored error pattern #^Parameter \#1 \$values of method Icinga\\Module\\Notifications\\Forms\\ChannelForm\:\:populate\(\) expects iterable\<string, mixed\>, ipl\\Orm\\Model\|null given\.$# in path /home/runner/work/icinga-notifications-web/icinga-notifications-web/application/controllers/ChannelController.php was not matched in reported errors.

Check failure on line 1 in application/controllers/ChannelController.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 7.3 on ubuntu-latest

Ignored error pattern #^Parameter \#2 \$channelId of class Icinga\\Module\\Notifications\\Forms\\ChannelForm constructor expects int\|null, mixed given\.$# in path /home/runner/work/icinga-notifications-web/icinga-notifications-web/application/controllers/ChannelController.php was not matched in reported errors.

Check failure on line 1 in application/controllers/ChannelController.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 7.3 on ubuntu-latest

Ignored error pattern #^Parameter \#2 \$value of static method ipl\\Stdlib\\Filter\:\:equal\(\) expects array\|bool\|float\|int\|string, mixed given\.$# in path /home/runner/work/icinga-notifications-web/icinga-notifications-web/application/controllers/ChannelController.php was not matched in reported errors.

/* Icinga Notifications Web | (c) 2023 Icinga GmbH | GPLv2 */

Expand All @@ -20,13 +20,13 @@
{
$channelId = $this->params->getRequired('id');
$form = (new ChannelForm(Database::get()))
->loadChannel($channelId)

Check failure on line 23 in application/controllers/ChannelController.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 7.2 on ubuntu-latest

Parameter #1 $id of method Icinga\Module\Notifications\Forms\ChannelForm::loadChannel() expects int, mixed given.

Check failure on line 23 in application/controllers/ChannelController.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 7.3 on ubuntu-latest

Parameter #1 $id of method Icinga\Module\Notifications\Forms\ChannelForm::loadChannel() expects int, mixed given.
->on(ChannelForm::ON_SUCCESS, function (ChannelForm $form) {
if ($form->getPressedSubmitElement()->getName() === 'delete') {
if ($form->getPressedSubmitElement()->getName() === 'remove') {
$form->removeChannel();
Notification::success(sprintf(
t('Deleted channel "%s" successfully'),
t('Removed channel "%s" successfully'),
$form->getValue('name')

Check failure on line 29 in application/controllers/ChannelController.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 7.2 on ubuntu-latest

Ignored error pattern #^Parameter \#2 \.\.\.\$values of function sprintf expects bool\|float\|int\|string\|null, mixed given\.$# in path /home/runner/work/icinga-notifications-web/icinga-notifications-web/application/controllers/ChannelController.php is expected to occur 3 times, but occurred only 2 times.

Check failure on line 29 in application/controllers/ChannelController.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 7.3 on ubuntu-latest

Ignored error pattern #^Parameter \#2 \.\.\.\$values of function sprintf expects bool\|float\|int\|string\|null, mixed given\.$# in path /home/runner/work/icinga-notifications-web/icinga-notifications-web/application/controllers/ChannelController.php is expected to occur 3 times, but occurred only 2 times.
));
} else {
$form->editChannel();
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/ContactController.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function indexAction(): void
})->on(ContactForm::ON_REMOVE, function (ContactForm $form) {
$form->removeContact();
Notification::success(sprintf(
t('Deleted contact "%s" successfully'),
t('Removed contact "%s" successfully'),
$form->getContactName()
));

Expand Down
4 changes: 2 additions & 2 deletions application/controllers/SourceController.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ public function indexAction(): void
->on(SourceForm::ON_SUCCESS, function (SourceForm $form) {
/** @var FormSubmitElement $pressedButton */
$pressedButton = $form->getPressedSubmitElement();
if ($pressedButton->getName() === 'delete') {
if ($pressedButton->getName() === 'remove') {
$form->removeSource();
Notification::success(sprintf(
$this->translate('Deleted source "%s" successfully'),
$this->translate('Removed source "%s" successfully'),
$form->getSourceName()
));
} else {
Expand Down
16 changes: 8 additions & 8 deletions application/forms/ChannelForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,12 @@ protected function assemble()
->first();
}

/** @var FormSubmitElement $deleteButton */
$deleteButton = $this->createElement(
/** @var FormSubmitElement $removeButton */
$removeButton = $this->createElement(
'submit',
'delete',
'remove',
[
'label' => $this->translate('Delete'),
'label' => $this->translate('Remove'),
'class' => 'btn-remove',
'formnovalidate' => true,
'disabled' => $isInUse !== null,
Expand All @@ -144,16 +144,16 @@ protected function assemble()
]
);

$this->registerElement($deleteButton);
$this->registerElement($removeButton);
$this->getElement('submit')
->getWrapper()
->prepend($deleteButton);
->prepend($removeButton);
}
}

public function isValid()
{
if ($this->getPressedSubmitElement()->getName() === 'delete') {
if ($this->getPressedSubmitElement()->getName() === 'remove') {
$csrfElement = $this->getElement('CSRFToken');

if (! $csrfElement->isValid()) {
Expand All @@ -168,7 +168,7 @@ public function isValid()

public function hasBeenSubmitted()
{
if ($this->getPressedSubmitElement() !== null && $this->getPressedSubmitElement()->getName() === 'delete') {
if ($this->getPressedSubmitElement() !== null && $this->getPressedSubmitElement()->getName() === 'remove') {
return true;
}

Expand Down
12 changes: 6 additions & 6 deletions application/forms/SourceForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,22 +220,22 @@ protected function assemble(): void
);

if ($this->sourceId !== null) {
/** @var FormSubmitElement $deleteButton */
$deleteButton = $this->createElement(
/** @var FormSubmitElement $removeButton */
$removeButton = $this->createElement(
'submit',
'delete',
'remove',
[
'label' => $this->translate('Delete'),
'label' => $this->translate('Remove'),
'class' => 'btn-remove',
'formnovalidate' => true
]
);

$this->registerElement($deleteButton);
$this->registerElement($removeButton);

/** @var BaseHtmlElement $submitWrapper */
$submitWrapper = $this->getElement('save')->getWrapper();
$submitWrapper->prepend($deleteButton);
$submitWrapper->prepend($removeButton);
}
}

Expand Down
16 changes: 8 additions & 8 deletions library/Notifications/Web/Form/ContactForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class ContactForm extends CompatForm
{
use CsrfCounterMeasure;

/** @var string Emitted in case the contact should be deleted */
/** @var string Emitted in case the contact should be removed */
public const ON_REMOVE = 'on_remove';

/** @var Connection */
Expand Down Expand Up @@ -56,7 +56,7 @@ private function hasBeenRemoved(): bool
$btn = $this->getPressedSubmitElement();
$csrf = $this->getElement('CSRFToken');

return $csrf !== null && $csrf->isValid() && $btn !== null && $btn->getName() === 'delete';
return $csrf !== null && $csrf->isValid() && $btn !== null && $btn->getName() === 'remove';
}

public function isValidEvent($event)
Expand Down Expand Up @@ -141,21 +141,21 @@ protected function assemble()
]
);
if ($this->contactId !== null) {
/** @var FormSubmitElement $deleteButton */
$deleteButton = $this->createElement(
/** @var FormSubmitElement $removeButton */
$removeButton = $this->createElement(
'submit',
'delete',
'remove',
[
'label' => $this->translate('Delete'),
'label' => $this->translate('Remove'),
'class' => 'btn-remove',
'formnovalidate' => true
]
);

$this->registerElement($deleteButton);
$this->registerElement($removeButton);
$this->getElement('submit')
->getWrapper()
->prepend($deleteButton);
->prepend($removeButton);
}
}

Expand Down
Loading