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

PrivacyStatement::main()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 9
rs 10
cc 1
nc 1
nop 0
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
}