Skip to content

Commit

Permalink
Enable bleeding edge rules for templates too (#185)
Browse files Browse the repository at this point in the history
Ref #141
  • Loading branch information
spaze authored Jul 22, 2023
2 parents e3f39e6 + e8af3c9 commit 876e81b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion site/app/Articles/articleHeaderIcons.latte
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{varType MichalSpacekCz\Articles\ArticlePublishedElsewhere|MichalSpacekCz\Articles\Blog\BlogPost $post}
{varType ?\DateTime $edited}
<div id="header-icons">
<div n:if="$post instanceof MichalSpacekCz\Articles\Components\ArticleWithPublishTime && $post->published">
<div n:if="$post->published">
{icon calendar}
<small>
<strong>{$post->published|localeDay}</strong>
Expand Down
2 changes: 1 addition & 1 deletion site/app/Articles/articleSummary.latte
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{varType MichalSpacekCz\Articles\ArticlePublishedElsewhere|MichalSpacekCz\Articles\Blog\BlogPost $article}
<a href="{$article->href}"><strong>{$article->title}</strong></a>
{control articleHeaderIcons $article}
<div class="indent small" n:if="$article instanceof MichalSpacekCz\Articles\Components\ArticleWithSummary">{$article->getSummary()} <p>(<a href="{$article->href}">{_messages.articles.readmore}</a>)</p></div>
<div class="indent small">{$article->getSummary()} <p>(<a href="{$article->href}">{_messages.articles.readmore}</a>)</p></div>
6 changes: 6 additions & 0 deletions site/phpstan-latte-templates.neon
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,14 @@ parameters:
- # `{input "applications-{$application->id}" ...}` is an `$application->id` input in `applications` container https://github.com/efabrica-team/phpstan-latte/pull/380 or https://github.com/efabrica-team/phpstan-latte/issues/400
message: '#^Call to an undefined method Nette\\Forms\\Controls\\BaseControl\|Statuses_[a-f0-9]+_applications::getControl\(\)#'
path: app/Admin/Presenters/templates/Trainings/date.latte
- # Uses `setView()` https://github.com/efabrica-team/phpstan-latte/issues/402
message: '#^Cannot resolve latte template for action#'
paths:
- app/Admin/Presenters/BlogPresenter.php
- app/EasterEgg/Presenters/NettePresenter.php

includes:
- phar://phpstan.phar/conf/bleedingEdge.neon
- vendor/phpstan/phpstan-nette/extension.neon
- vendor/phpstan/phpstan-nette/rules.neon
- vendor/efabrica/phpstan-latte/rules.neon

0 comments on commit 876e81b

Please sign in to comment.