Completed
Push — develop ( 085115...b1372b )
by greg
30:06
created

CountryName::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace PlaygroundCore\View\Helper;
4
5
use Zend\View\Helper\AbstractHelper;
6
7
class CountryName extends AbstractHelper
8
{
9
    protected $service = null;
10
11
    public function __construct(\PlaygroundCore\Service\Country $service)
12
    {
13
        $this->service = $service;
14
    }
15
16
    public function __invoke($code, $locale = null)
17
    {
18
        if (empty($locale)) {
19
            $locale = $this->service->getServiceManager()->get('translator')->getLocale();
20
        }
21
22
        return $this->service->getCountry($code, $locale);
23
    }
24
}
25