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

CountryName::__invoke()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 8
rs 9.4285
cc 2
eloc 4
nc 2
nop 2
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