Test Failed
Push — master ( e3c39f...fe570d )
by Mihail
07:20
created

View/Front/default/widgets/newcomment/default.php (1 issue)

1
<?php
2
3
use Apps\Model\Api\Comments\EntityCommentData;
4
use Ffcms\Core\Helper\Date;
5
use Ffcms\Core\Helper\Text;
6
use Ffcms\Templex\Url\Url;
7
8
/** @var EntityCommentData[] $comments */
9
/** @var \Ffcms\Core\Arch\View $this */
10
/** @var int $snippet */
11
?>
12
<?php foreach ($comments as $comment):?>
13
<div class="mb-1 short-comment">
14
    <div class="row mb-1">
15
        <div class="col-md-6">
16
            <i class="fa fa-user"></i>
17
            <?php if ((int)$comment['user']['id'] > 0): ?>
18
                <?= Url::a(['profile/show', [$comment['user']['id']]], $comment['user']['name'], ['style' => 'color: #595959']) ?>
19
            <?php else: ?>
20
                <?= $comment['user']['name'] ?>
21
            <?php endif; ?>
22
        </div>
23
        <div class="col-md-6 pull-right">
24
            <small class="text-secondary pull-right">
25
                <i class="fa fa-calendar"></i> <?= Date::humanize($comment['date']) ?>
0 ignored issues
show
Are you sure Ffcms\Core\Helper\Date::...anize($comment['date']) of type false|string can be used in echo? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

25
                <i class="fa fa-calendar"></i> <?= /** @scrutinizer ignore-type */ Date::humanize($comment['date']) ?>
Loading history...
26
            </small>
27
        </div>
28
    </div>
29
30
    <div class="row">
31
        <div class="col widget-comment-text">
32
            <a href="<?= \App::$Alias->baseUrl . '/' . $comment['app_name'] . '/comments/' . $comment['app_id'] ?>">
33
                <?= Text::cut(\App::$Security->strip_tags($comment['text']), 0, $snippet) ?>
34
            </a>
35
        </div>
36
    </div>
37
</div>
38
<?php endforeach; ?>
39