GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

ConsoleOutput::formatSSpage()   A
last analyzed

Complexity

Conditions 3
Paths 4

Size

Total Lines 22
Code Lines 16

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 22
rs 9.2
c 0
b 0
f 0
cc 3
eloc 16
nc 4
nop 2
1
<?php
2
3
namespace Selim;
4
5
class ConsoleOutput extends Output implements IOutput
6
{
7
    public function write($format = '')
8
    {
9
        foreach ($this->pages as $sspage) {
10
            if ($sspage instanceof SilverstripePage) {
11
                echo self::formatSSpage($sspage, $format);
12
            }
13
        }
14
    }
15
16
    private static $format_default = "Site:            %s%nVersion:         %v%nDefaultAdmin:    %da%nEmailLogging:    %el%nEnvironmentType: %et%nModules:         %mo%n%n";
17
18
    private static function formatSSpage(SilverstripePage $sspage, $format = '')
19
    {
20
        $format = $format ? $format : self::$format_default;
21
        $placeholders = array(
22
            "%n" => PHP_EOL,
23
            "%s" => $sspage->getName(),
24
            "%v" => $sspage->getVersion(),
25
            "%da" => self::DefaultAdminText($sspage),
26
            "%el" => self::EmailLoggingText($sspage),
27
            "%et" => $sspage->getEnvironmentType(),
28
            "%mo" =>  self::ModuleText($sspage),
29
            "%cfgp" => $sspage->getConfigPhpPath(),
30
            "%cfgy" => $sspage->getConfigYmlPath(),
31
            "%root" => $sspage->getRootPath(),
32
        );
33
34
        foreach ($placeholders as $p => $v) {
35
            $format = str_replace($p, $v, $format);
36
        }
37
38
        return $format;
39
    }
40
}
41