Conditions | 4 |
Paths | 2 |
Total Lines | 37 |
Code Lines | 24 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
28 | static function show_posts_list ($posts, $posts_count, $page, $base_url) { |
||
29 | $module_data = Config::instance()->module('Blogs'); |
||
30 | $L = new Prefix('blogs_'); |
||
31 | $Page = Page::instance(); |
||
32 | $Page->content( |
||
33 | h::cs_blogs_head_actions() |
||
34 | ); |
||
35 | if (!$posts) { |
||
36 | $Page->content( |
||
37 | h::{'p.cs-text-center'}($L->no_posts_yet) |
||
38 | ); |
||
39 | return; |
||
40 | } |
||
41 | $Page->content( |
||
42 | h::{'section[is=cs-blogs-posts]'}( |
||
43 | h::{'script[type=application/ld+json]'}( |
||
44 | json_encode( |
||
45 | Posts::instance()->get_as_json_ld($posts), |
||
46 | JSON_UNESCAPED_UNICODE |
||
47 | ) |
||
48 | ), |
||
49 | [ |
||
50 | 'comments_enabled' => $module_data->enable_comments && functionality('comments') |
||
51 | ] |
||
52 | ). |
||
53 | h::{'.cs-block-margin.cs-text-center.cs-margin nav[is=cs-nav-pagination]'}( |
||
54 | pages( |
||
55 | $page, |
||
56 | ceil($posts_count / $module_data->posts_per_page), |
||
57 | function ($page) use ($base_url) { |
||
58 | return $base_url.($page > 1 ? "/$page" : ''); |
||
59 | }, |
||
60 | true |
||
61 | ) |
||
62 | ) |
||
63 | ); |
||
64 | } |
||
65 | } |
||
66 |
This check compares the return type specified in the
@return
annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.