Skip to content

Commit dad965c

Browse files
authored
PHPStan Latte level 5 (#173)
* Change action `$param` type to int where possible * Work around efabrica-team/phpstan-latte#396 Ref #141
2 parents 45373be + c459e04 commit dad965c

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

site/app/Admin/Presenters/ReviewsPresenter.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ public function actionDefault(): void
2424
}
2525

2626

27-
public function actionTraining(string $param): void
27+
public function actionTraining(int $param): void
2828
{
29-
$training = $this->trainings->getById((int)$param);
29+
$training = $this->trainings->getById($param);
3030

3131
$this->template->pageTitle = 'Ohlasy na ' . $training->name;
32-
$this->template->reviews = $this->trainingReviews->getAllReviews((int)$param);
32+
$this->template->reviews = $this->trainingReviews->getAllReviews($param);
3333
}
3434

3535
}

site/app/Admin/Presenters/TalksPresenter.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ public function renderDefault(): void
4949
}
5050

5151

52-
public function actionTalk(string $param): void
52+
public function actionTalk(int $param): void
5353
{
5454
try {
55-
$this->talk = $this->talks->getById((int)$param);
55+
$this->talk = $this->talks->getById($param);
5656
} catch (TalkDoesNotExistException $e) {
5757
throw new BadRequestException($e->getMessage(), previous: $e);
5858
}
@@ -62,10 +62,10 @@ public function actionTalk(string $param): void
6262
}
6363

6464

65-
public function actionSlides(string $param): void
65+
public function actionSlides(int $param): void
6666
{
6767
try {
68-
$this->talk = $this->talks->getById((int)$param);
68+
$this->talk = $this->talks->getById($param);
6969
$this->slides = $this->talkSlides->getSlides($this->talk->getId(), $this->talk->getFilenamesTalkId());
7070
} catch (ContentTypeException | TalkDoesNotExistException $e) {
7171
throw new BadRequestException($e->getMessage(), previous: $e);

site/app/Admin/Presenters/templates/Pulse/passwordsStorages.latte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
<tr n:if="$i != 0"><td></td><td><small><a href="#newdisclosure-{$i}"><span>add {$i + 1}. disclosure</span><span class="hidden">cancel adding</span></a></small></td></tr>
8383
<tbody id="newdisclosure-{$i}" n:class="$i != 0 ? hidden">
8484
{formContainer new}
85-
{formContainer $i}
85+
{formContainer "$i"}
8686
<tr><th>{label disclosure /}</th><td>{input disclosure}</td></tr>
8787
<tr><th>{label url /}</th><td>{input url}</td></tr>
8888
<tr><th>{label archive /}</th><td>{input archive}</td></tr>

site/app/Admin/Presenters/templates/Talks/slides.latte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
{/formContainer}
6363
{formContainer new}
6464
{for $i = 0; $i < $newCount; $i++}
65-
{formContainer $i}
65+
{formContainer "$i"}
6666
<tbody class="new-slide changed">
6767
<tr>
6868
<th class="right">Číslo</th>

site/phpstan-latte-templates.neon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ parameters:
22
tmpDir: /tmp/phpstan/michalspacek.cz-latte-templates
33
paths:
44
- app
5-
level: 4
5+
level: 5
66
latte:
77
engineBootstrap: app/PhpStan/latteEngine.php
88
presenterFactoryBootstrap: app/PhpStan/presenterFactory.php

0 commit comments

Comments
 (0)