_TranslateHandler::getContainer()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

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