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

View/Front/default/widgets/newcontent/default.php (2 issues)

Checks if there maybe is a typo in property declarations.

Bug Major
1
<?php
2
/** @var \Apps\ActiveRecord\Content[] $records */
3
4
use Ffcms\Core\Helper\Date;
5
use Ffcms\Core\Helper\Text;
6
use Ffcms\Core\Helper\Type\Str;
7
8
foreach ($records as $record) {
9
    $title = \App::$Translate->getLocaleText($record->title);
10
    if (Str::likeEmpty($title)) {
11
        continue;
12
    }
13
    $title = Text::snippet($title, 50);
14
    $date = Date::humanize($record->created_at);
15
    $categoryUrl = \App::$Alias->baseUrl . '/content/list/' . $record->cpath;
0 ignored issues
show
The property cpath does not exist on Apps\ActiveRecord\Content. Did you mean path?
Loading history...
16
    $categoryLink = '<a href="' . $categoryUrl . '">' . \App::$Translate->getLocaleText($record->ctitle) . '</a>';
0 ignored issues
show
The property ctitle does not exist on Apps\ActiveRecord\Content. Did you mean title?
Loading history...
17
    $newsLink = \App::$Alias->baseUrl . '/content/read/' . $record->cpath;
18
    $newsLink = rtrim($newsLink, '/') . '/' . $record->path;
19
20
    echo '<div class="row"><div class="col-md-12">';
21
    echo '<a href="' . $newsLink . '">&rarr; ' . $title . '</a><br />';
22
    echo '<small class="float-left">' . $categoryLink . '</small>';
23
    echo '<small class="float-right text-secondary">' . $date . '</small>';
24
    echo '</div></div>';
25
    echo '<hr class="pretty" />';
26
}
27
?>