AdminLocalization   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 2
1
<?php
2
3
/**
4
 * Admin localization
5
 * @copyright Copyright (c) 2011 - 2014 Aleksandr Torosh (http://wezoom.com.ua)
6
 * @author Aleksandr Torosh <[email protected]>
7
 */
8
9
namespace YonaCMS\Plugin;
10
11
use Phalcon\Mvc\User\Plugin;
12
13
class AdminLocalization extends Plugin
14
{
15
16
    public function __construct($config)
17
    {
18
        $file = APPLICATION_PATH . '/../data/translations/admin/' . $config->admin_language . '.php';
19
        if (!is_file($file)) {
20
            die("file $file not exists");
21
        }
22
        $translations = include($file);
23
        $this->getDI()->set('admin_translate', new \Phalcon\Translate\Adapter\NativeArray(array('content' => $translations)));
0 ignored issues
show
Bug introduced by
The method set cannot be called on $this->getDI() (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
24
25
    }
26
27
}
28