BaseHomePageController   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 16
rs 10
c 0
b 0
f 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getNewsPage() 0 3 1
A getNewsItems() 0 6 2
1
<?php
2
3
namespace CWP\CWP\PageTypes;
4
5
use PageController;
0 ignored issues
show
Bug introduced by
The type PageController 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...
6
7
class BaseHomePageController extends PageController
8
{
9
    public function getNewsPage()
10
    {
11
        return NewsHolder::get_one(NewsHolder::class);
12
    }
13
14
    /**
15
     * @param int $amount The amount of items to provide.
16
     */
17
    public function getNewsItems($amount = 2)
18
    {
19
        $newsHolder = $this->getNewsPage();
20
        if ($newsHolder) {
21
            $controller = NewsHolderController::create($newsHolder);
22
            return $controller->Updates()->limit($amount);
23
        }
24
    }
25
}
26