Completed
Pull Request — master (#70)
by Daniel
04:46
created

StaticPublisherTestPage   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 20
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A canPublish() 0 4 1
A getTemplate() 0 6 1
1
<?php
2
3
namespace SilverStripe\StaticPublishQueue\Test\StaticPublisherTest\Model;
4
5
use Page;
6
use SilverStripe\Core\Manifest\ModuleLoader;
7
use SilverStripe\Dev\TestOnly;
8
9
class StaticPublisherTestPage extends Page implements TestOnly
10
{
11
12
    private static $allowed_children = array(
0 ignored issues
show
Unused Code introduced by
The property $allowed_children is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
13
        StaticPublisherTestPage::class
14
    );
15
16
17
    public function canPublish($member = null)
18
    {
19
        return true;
20
    }
21
22
    public function getTemplate()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
23
    {
24
        $templateResource = ModuleLoader::getModule('silverstripe/staticpublishqueue')
0 ignored issues
show
Bug introduced by
The method getResource() does not exist on SilverStripe\Core\Manifest\Module. Did you maybe mean getResourcePath()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
25
            ->getResource('/tests/templates/StaticPublisherTestPage.ss');
26
        return $templateResource->getPath();
27
    }
28
}
29