_TranslateHandler   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 29
rs 10
c 0
b 0
f 0
wmc 4

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __get() 0 4 2
A getContainer() 0 3 1
A __construct() 0 3 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: afshin
5
 * Date: 11/20/17
6
 * Time: 10:46 AM
7
 */
8
9
namespace Core\Translator;
10
11
12
use Psr\Container\ContainerInterface;
13
14
abstract class _TranslateHandler
15
{
16
    protected $container ;
17
    protected $local;
18
19
    function __construct(ContainerInterface $container)
20
    {
21
        $this->container = $container;
22
    }
23
24
    public function __get($property)
25
    {
26
        if ($this->container->{$property}) {
27
            return $this->container->{$property};
28
        }
29
    }
30
31
32
    /**
33
     * Get Slim Container
34
     *
35
     * @return ContainerInterface
36
     */
37
    protected function getContainer()
38
    {
39
        return $this->container;
40
    }
41
42
    abstract public function trans(string $key , array $replace);
43
}