Skip to content

Commit c5f1083

Browse files
(Host|Service)Controller: Add return type to methods
1 parent 21d5706 commit c5f1083

File tree

2 files changed

+17
-16
lines changed

2 files changed

+17
-16
lines changed

application/controllers/HostController.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class HostController extends Controller
4747
/** @var Host The host object */
4848
protected $host;
4949

50-
public function init()
50+
public function init(): void
5151
{
5252
$name = $this->params->shiftRequired('name');
5353

@@ -76,7 +76,7 @@ public function init()
7676
$this->setTitle($host->display_name);
7777
}
7878

79-
public function indexAction()
79+
public function indexAction(): void
8080
{
8181
$serviceSummary = ServicestateSummary::on($this->getDb());
8282
$serviceSummary->filter(Filter::equal('service.host_id', $this->host->id));
@@ -95,7 +95,7 @@ public function indexAction()
9595
$this->setAutorefreshInterval(10);
9696
}
9797

98-
public function sourceAction()
98+
public function sourceAction(): void
9999
{
100100
$this->assertPermission('icingadb/object/show-source');
101101

@@ -114,7 +114,7 @@ public function sourceAction()
114114
));
115115
}
116116

117-
public function historyAction()
117+
public function historyAction(): \Generator
118118
{
119119
$compact = $this->view->compact; // TODO: Find a less-legacy way..
120120

@@ -185,7 +185,7 @@ public function historyAction()
185185
}
186186
}
187187

188-
public function servicesAction()
188+
public function servicesAction(): \Generator
189189
{
190190
if ($this->host->state->is_overdue) {
191191
$this->controls->addAttributes(['class' => 'overdue']);
@@ -234,7 +234,7 @@ public function servicesAction()
234234
$this->setAutorefreshInterval(10);
235235
}
236236

237-
public function parentsAction()
237+
public function parentsAction(): void
238238
{
239239
$nodesQuery = $this->fetchNodes(true);
240240

@@ -293,7 +293,7 @@ public function parentsAction()
293293
$this->setAutorefreshInterval(10);
294294
}
295295

296-
public function childrenAction()
296+
public function childrenAction(): void
297297
{
298298
$nodesQuery = $this->fetchNodes();
299299

@@ -473,7 +473,7 @@ protected function createTabs(): Tabs
473473
return $tabs;
474474
}
475475

476-
protected function setTitleTab(string $name)
476+
protected function setTitleTab(string $name): void
477477
{
478478
$tab = $this->createTabs()->get($name);
479479

application/controllers/ServiceController.php

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
use ipl\Web\Control\LimitControl;
3232
use ipl\Web\Control\SortControl;
3333
use ipl\Web\Url;
34+
use ipl\Web\Widget\Tabs;
3435

3536
class ServiceController extends Controller
3637
{
@@ -40,7 +41,7 @@ class ServiceController extends Controller
4041
/** @var Service The service object */
4142
protected $service;
4243

43-
public function init()
44+
public function init(): void
4445
{
4546
$name = $this->params->shiftRequired('name');
4647
$hostName = $this->params->shiftRequired('host.name');
@@ -85,7 +86,7 @@ public function init()
8586
);
8687
}
8788

88-
public function indexAction()
89+
public function indexAction(): void
8990
{
9091
if ($this->service->state->is_overdue) {
9192
$this->controls->addAttributes(['class' => 'overdue']);
@@ -99,7 +100,7 @@ public function indexAction()
99100
$this->setAutorefreshInterval(10);
100101
}
101102

102-
public function parentsAction()
103+
public function parentsAction(): void
103104
{
104105
$nodesQuery = $this->fetchNodes(true);
105106

@@ -159,7 +160,7 @@ public function parentsAction()
159160
$this->setAutorefreshInterval(10);
160161
}
161162

162-
public function childrenAction()
163+
public function childrenAction(): void
163164
{
164165
$nodesQuery = $this->fetchNodes();
165166

@@ -222,7 +223,7 @@ public function childrenAction()
222223
$this->setAutorefreshInterval(10);
223224
}
224225

225-
public function sourceAction()
226+
public function sourceAction(): void
226227
{
227228
$this->assertPermission('icingadb/object/show-source');
228229

@@ -241,7 +242,7 @@ public function sourceAction()
241242
));
242243
}
243244

244-
public function historyAction()
245+
public function historyAction(): \Generator
245246
{
246247
$compact = $this->view->compact; // TODO: Find a less-legacy way..
247248

@@ -392,7 +393,7 @@ protected function fetchNodes(bool $fetchParents = false): Query
392393
return $query;
393394
}
394395

395-
protected function createTabs()
396+
protected function createTabs(): Tabs
396397
{
397398
$hasDependecyNode = DependencyNode::on($this->getDb())
398399
->columns('1')
@@ -445,7 +446,7 @@ protected function createTabs()
445446
return $tabs;
446447
}
447448

448-
protected function setTitleTab(string $name)
449+
protected function setTitleTab(string $name): void
449450
{
450451
$tab = $this->createTabs()->get($name);
451452

0 commit comments

Comments
 (0)