Completed
Push — master ( 6dd56a...f17316 )
by Jakub
05:55
created

ManualLocaleResolver   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 80%

Importance

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

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
 */
14 1
final class ManualLocaleResolver implements ISettableLocaleResolver {
15
  use \Nette\SmartObject;
16
17
  public ?string $lang = null;
18
19
  /**
20
   * @deprecated Access the property directly
21
   */
22
  public function getLang(): ?string {
23
    return $this->lang;
24
  }
25
26
  /**
27
   * @deprecated Access the property directly
28
   */
29
  public function setLang(?string $lang): void {
30 1
    $this->lang = $lang;
31 1
  }
32
  
33
  public function resolve(): ?string {
34 1
    return $this->lang;
35
  }
36
}
37
?>