Passed
Push — multiproject/local-access ( b11ab6...998948 )
by Simon
11:26 queued 06:26
created

PrivacyStatement   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 6
c 1
b 0
f 0
dl 0
loc 16
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A main() 0 9 1
1
<?php
2
/******************************************************************************
3
 * Wikipedia Account Creation Assistance tool                                 *
4
 * ACC Development Team. Please see team.json for a list of contributors.     *
5
 *                                                                            *
6
 * This is free and unencumbered software released into the public domain.    *
7
 * Please see LICENSE.md for the full licencing statement.                    *
8
 ******************************************************************************/
9
10
namespace Waca\Fragments;
11
12
use Waca\Helpers\MarkdownRenderingHelper;
13
14
trait PrivacyStatement
15
{
16
    protected abstract function assign($name, $value);
17
    protected abstract function templatePath();
18
    protected abstract function setTemplate($name);
19
    protected abstract function getSiteConfiguration();
20
21
    protected function main()
22
    {
23
        $path = $this->getSiteConfiguration()->getPrivacyStatementPath();
24
        $markdown = file_get_contents($path);
25
26
        $renderer = new MarkdownRenderingHelper();
27
        $this->assign('content', $renderer->doRender($markdown));
28
29
        $this->setTemplate($this->templatePath());
30
    }
31
}