AdminLocalization::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.9332
c 0
b 0
f 0
cc 2
nc 2
nop 1
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