Skip to content

Commit 13e4dcb

Browse files
authored
Adapt to IPL strict typing in forms and i18n helpers (#617)
Use `ipl\Stdlib\Events` in form subclasses to satisfy IPL’s strict typing, which is not met by using `EventEmitterTrait` directly. Replace `gipfl\Translation\TranslationHelper` with `ipl\I18n\Translation` for i18n support in UI classes. The module already uses IPL broadly for other concerns, so this removes a redundant dependency and aligns with IPL’s strict‑typing requirements.
1 parent 836498f commit 13e4dcb

70 files changed

Lines changed: 141 additions & 140 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

library/Vspheredb/Hint/ConnectionStateDetails.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
namespace Icinga\Module\Vspheredb\Hint;
44

5-
use gipfl\Translation\TranslationHelper;
5+
use ipl\I18n\Translation;
66

77
class ConnectionStateDetails
88
{
9-
use TranslationHelper;
9+
use Translation;
1010

1111
protected static $instance;
1212

library/Vspheredb/Monitoring/Rule/Definition/MonitoringRuleDefinition.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22

33
namespace Icinga\Module\Vspheredb\Monitoring\Rule\Definition;
44

5-
use gipfl\Translation\TranslationHelper;
65
use Icinga\Module\Vspheredb\DbObject\BaseDbObject;
76
use Icinga\Module\Vspheredb\Monitoring\Rule\Enum\ObjectType;
87
use Icinga\Module\Vspheredb\Monitoring\Rule\Settings;
98
use Icinga\Module\Vspheredb\Monitoring\SingleCheckResult;
9+
use ipl\I18n\Translation;
1010

1111
use function in_array;
1212

1313
abstract class MonitoringRuleDefinition
1414
{
15-
use TranslationHelper;
15+
use Translation;
1616

1717
public const SUPPORTED_OBJECT_TYPES = [];
1818

library/Vspheredb/Monitoring/Rule/Definition/MonitoringRuleSetDefinition.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
namespace Icinga\Module\Vspheredb\Monitoring\Rule\Definition;
44

5-
use gipfl\Translation\TranslationHelper;
5+
use ipl\I18n\Translation;
66

77
abstract class MonitoringRuleSetDefinition
88
{
9-
use TranslationHelper;
9+
use Translation;
1010

1111
/** @var string[]|MonitoringRuleDefinition[] Type hint, these are class names */
1212
public const RULE_CLASSES = [];

library/Vspheredb/Monitoring/Rule/MonitoringRulesTree.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
namespace Icinga\Module\Vspheredb\Monitoring\Rule;
44

5-
use gipfl\Translation\TranslationHelper;
65
use Icinga\Module\Vspheredb\Db;
76
use Icinga\Module\Vspheredb\DbObject\BaseDbObject;
7+
use ipl\I18n\Translation;
88

99
class MonitoringRulesTree
1010
{
11-
use TranslationHelper;
11+
use Translation;
1212

1313
public const ROOT_OBJECT_TYPE = 'root';
1414

library/Vspheredb/Monitoring/Rule/MonitoringRulesTreeRenderer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
namespace Icinga\Module\Vspheredb\Monitoring\Rule;
44

55
use gipfl\IcingaWeb2\Link;
6-
use gipfl\Translation\TranslationHelper;
76
use Icinga\Module\Vspheredb\Util;
87
use ipl\Html\BaseHtmlElement;
98
use ipl\Html\Html;
109
use ipl\Html\HtmlElement;
10+
use ipl\I18n\Translation;
1111

1212
class MonitoringRulesTreeRenderer extends BaseHtmlElement
1313
{
14-
use TranslationHelper;
14+
use Translation;
1515

1616
protected $tag = 'ul';
1717

library/Vspheredb/Monitoring/Rule/RuleForm.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace Icinga\Module\Vspheredb\Monitoring\Rule;
44

5-
use gipfl\Translation\TranslationHelper;
65
use gipfl\Web\Form;
76
use Icinga\Module\Vspheredb\Db;
87
use Icinga\Module\Vspheredb\Monitoring\Rule\Definition\MonitoringRuleDefinition as Rule;
@@ -14,12 +13,13 @@
1413
use ipl\Html\FormElement\SelectElement;
1514
use ipl\Html\FormElement\TextElement;
1615
use ipl\Html\Html;
16+
use ipl\I18n\Translation;
1717
use Ramsey\Uuid\Uuid;
1818
use Ramsey\Uuid\UuidInterface;
1919

2020
class RuleForm extends Form
2121
{
22-
use TranslationHelper;
22+
use Translation;
2323

2424
public const NEXT_UUID = '00000000-0000-0000-0000-000000000000';
2525
public const RESULT_CREATED = 'created';

library/Vspheredb/Web/Form/ApplyMigrationsForm.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
namespace Icinga\Module\Vspheredb\Web\Form;
44

55
use gipfl\DbMigration\Migrations;
6-
use gipfl\Translation\TranslationHelper;
76
use gipfl\Web\Form;
87
use gipfl\Web\Widget\Hint;
98
use Icinga\Web\Notification;
9+
use ipl\I18n\Translation;
1010

1111
class ApplyMigrationsForm extends Form
1212
{
13-
use TranslationHelper;
13+
use Translation;
1414

1515
/** @var Migrations */
1616
protected $migrations;

library/Vspheredb/Web/Form/ChooseDbResourceForm.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@
55
use Exception;
66
use gipfl\DbMigration\Migrations;
77
use gipfl\IcingaWeb2\Link;
8-
use gipfl\Translation\TranslationHelper;
98
use gipfl\Web\Form;
109
use gipfl\Web\Widget\Hint;
1110
use Icinga\Application\Config;
1211
use Icinga\Data\ResourceFactory;
1312
use Icinga\Module\Vspheredb\Db;
1413
use Icinga\Web\Notification;
1514
use ipl\Html\Html;
15+
use ipl\I18n\Translation;
1616

1717
class ChooseDbResourceForm extends Form
1818
{
19-
use TranslationHelper;
19+
use Translation;
2020

2121
private $config;
2222

library/Vspheredb/Web/Form/ChooseInfluxDatabaseForm.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@
22

33
namespace Icinga\Module\Vspheredb\Web\Form;
44

5-
use gipfl\Translation\TranslationHelper;
65
use gipfl\Web\Form;
76
use gipfl\Web\Form\Element\TextWithActionButton;
87
use Icinga\Module\Vspheredb\Daemon\RemoteClient;
98
use Icinga\Module\Vspheredb\Hook\PerfDataConsumerHook;
109
use Icinga\Web\Notification;
1110
use ipl\Html\FormElement\BaseFormElement;
1211
use ipl\Html\FormElement\SelectElement;
12+
use ipl\I18n\Translation;
1313
use React\EventLoop\LoopInterface;
1414

1515
use function React\Async\await;
1616
use function React\Promise\Timer\timeout;
1717

1818
class ChooseInfluxDatabaseForm extends Form
1919
{
20-
use TranslationHelper;
20+
use Translation;
2121

2222
/** @var LoopInterface */
2323
protected $loop;

library/Vspheredb/Web/Form/DeleteVCenterForm.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace Icinga\Module\Vspheredb\Web\Form;
44

5-
use gipfl\Translation\TranslationHelper;
65
use gipfl\Web\Form;
76
use gipfl\Web\Form\Feature\NextConfirmCancel;
87
use gipfl\Web\Widget\Hint;
@@ -11,14 +10,15 @@
1110
use Icinga\Module\Vspheredb\DbObject\VCenter;
1211
use Icinga\Web\Notification;
1312
use ipl\Html\Html;
13+
use ipl\I18n\Translation;
1414
use Ramsey\Uuid\Uuid;
1515
use React\EventLoop\LoopInterface;
1616

1717
use function React\Async\await;
1818

1919
class DeleteVCenterForm extends Form
2020
{
21-
use TranslationHelper;
21+
use Translation;
2222

2323
protected $defaultDecoratorClass = null;
2424

0 commit comments

Comments
 (0)