ManualLocaleResolver   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 6
c 1
b 0
f 0
dl 0
loc 16
rs 10
ccs 6
cts 6
cp 1

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getLang() 0 2 1
A setLang() 0 2 1
A resolve() 0 2 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Nexendrie\Translation\Resolvers;
5
6
use Nexendrie\Translation\ISettableLocaleResolver;
7
8
/**
9
 * ManualLocaleResolver
10
 * Allows you to manually specify current language
11
 *
12
 * @author Jakub Konečný
13
 * @property string|null $lang
14
 */
15 1
final class ManualLocaleResolver implements ISettableLocaleResolver {
16 1
  use \Nette\SmartObject;
17
  
18
  /** @var string|null */
19
  protected $lang = null;
20
  
21
  public function getLang(): ?string {
22 1
    return $this->lang;
23
  }
24
  
25
  public function setLang(string $lang): void {
26 1
    $this->lang = $lang;
27 1
  }
28
  
29
  public function resolve(): ?string {
30 1
    return $this->getLang();
31
  }
32
}
33
?>