RSSFeedController::index()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 6
nc 1
nop 0
dl 0
loc 10
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: gordon
5
 * Date: 29/4/2561
6
 * Time: 15:05 น.
7
 */
8
9
namespace Suilven\RSS\Controller;
10
11
12
use SilverStripe\CMS\Controllers\ContentController;
0 ignored issues
show
Bug introduced by
The type SilverStripe\CMS\Controllers\ContentController was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
13
use SilverStripe\Control\RSS\RSSFeed;
0 ignored issues
show
Bug introduced by
The type SilverStripe\Control\RSS\RSSFeed was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
14
15
class RSSFeedController extends ContentController
16
{
17
    public function init()
18
    {
19
        parent::init();
20
    }
21
22
    public function index()
23
    {
24
        $rss = new RSSFeed(
25
            $this->LatestUpdates(),
26
            $this->Link(),
27
            "25 Most Recently Created Pages",
28
            "Shows a list of the 25 most recently updated pages."
29
        );
30
31
        return $rss->outputToBrowser();
32
    }
33
34
    public function LatestUpdates()
35
    {
36
        return \Page::get()->sort("Created", "DESC")->limit(25);
0 ignored issues
show
Bug introduced by
The type Page was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
37
    }
38
}
39