These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | declare(strict_types=1); |
||
3 | |||
4 | namespace Nexendrie\Translation\Resolvers; |
||
5 | |||
6 | /** |
||
7 | * ManualLocaleResolver |
||
8 | * Allows you to manually specify current language |
||
9 | * |
||
10 | * @author Jakub Konečný |
||
11 | * @property string|NULL $lang |
||
12 | */ |
||
13 | 1 | class ManualLocaleResolver implements ILocaleResolver { |
|
14 | 1 | use \Nette\SmartObject; |
|
15 | |||
16 | /** @var string|NULL */ |
||
17 | protected $lang = NULL; |
||
18 | |||
19 | function getLang(): ?string { |
||
0 ignored issues
–
show
|
|||
20 | 1 | return $this->lang; |
|
21 | } |
||
22 | |||
23 | function setLang(string $lang) { |
||
0 ignored issues
–
show
|
|||
24 | 1 | $this->lang = $lang; |
|
25 | 1 | } |
|
26 | |||
27 | function resolve(): ?string { |
||
0 ignored issues
–
show
|
|||
28 | 1 | return $this->getLang(); |
|
29 | } |
||
30 | } |
||
31 | ?> |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.