Plugin   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 21
ccs 6
cts 6
cp 1
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A onPluginsLoaded() 0 8 1
1
<?php
2
/**
3
 * Plugin class
4
 */
5
namespace Phile\Plugin\Phile\TemplateTwig;
6
7
use Phile\Core\Container;
8
use Phile\Core\ServiceLocator;
9
use Phile\Plugin\AbstractPlugin;
10
use Phile\Plugin\Phile\TemplateTwig\Template\Twig;
11
12
/**
13
 * Class Plugin
14
 * Default Phile template engine
15
 *
16
 * @author  PhileCMS
17
 * @link    https://philecms.github.io
18
 * @license http://opensource.org/licenses/MIT
19
 * @package Phile\Plugin\Phile\TemplateTwig
20
 */
21
class Plugin extends AbstractPlugin
22
{
23
    /**
24
     * {@inheritdoc}
25
     */
26
    protected $events = ['plugins_loaded' => 'onPluginsLoaded'];
27
28
    /**
29
     * Registers Twig as template service
30
     *
31
     * @param array $data
32
     * @return void
33
     */
34 34
    public function onPluginsLoaded($data)
0 ignored issues
show
Unused Code introduced by
The parameter $data is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

34
    public function onPluginsLoaded(/** @scrutinizer ignore-unused */ $data)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
35
    {
36 34
        $phile = Container::getInstance()->get('Phile_Config');
37 34
        $settings = $this->settings + [
38 34
            'theme' => $phile->get('theme'),
39 34
            'themes_dir' => $phile->get('themes_dir')
40
        ];
41 34
        ServiceLocator::registerService('Phile_Template', new Twig($settings));
42
    }
43
}
44