4
4
5
5
namespace SamJUK \MediaProxy \Model ;
6
6
7
- use SamJUK \MediaProxy \Enum \Mode ;
7
+ use SamJUK \MediaProxy \Model \ Config \ Source \Mode ;
8
8
use SamJUK \MediaProxy \Api \ConfigInterface ;
9
9
use Magento \Framework \App \Config \ScopeConfigInterface ;
10
10
@@ -14,7 +14,8 @@ class Config implements ConfigInterface
14
14
private const XML_PATH_MODE = 'samjuk_media_proxy/general/mode ' ;
15
15
private const XML_PATH_UPSTREAM_HOST = 'samjuk_media_proxy/general/upstream_host ' ;
16
16
17
- private readonly ScopeConfigInterface $ scopeConfig ;
17
+ /** @readonly */
18
+ private ScopeConfigInterface $ scopeConfig ;
18
19
19
20
public function __construct (
20
21
ScopeConfigInterface $ scopeConfigInterface
@@ -32,19 +33,19 @@ public function getUpstreamHost(): string
32
33
return rtrim ($ this ->getValue (self ::XML_PATH_UPSTREAM_HOST ), '/ ' );
33
34
}
34
35
35
- public function getMode (): Mode
36
+ public function getMode (): string
36
37
{
37
- return Mode:: from ( $ this ->getValue (self ::XML_PATH_MODE ) );
38
+ return $ this ->getValue (self ::XML_PATH_MODE );
38
39
}
39
40
40
41
public function isProxyMode (): bool
41
42
{
42
- return $ this ->isEnabled () && $ this ->getMode () === Mode::Proxy ;
43
+ return $ this ->isEnabled () && $ this ->getMode () === Mode::PROXY ;
43
44
}
44
45
45
46
public function isCacheMode (): bool
46
47
{
47
- return $ this ->isEnabled () && $ this ->getMode () === Mode::Cache ;
48
+ return $ this ->isEnabled () && $ this ->getMode () === Mode::CACHE ;
48
49
}
49
50
50
51
private function getFlag ($ path , $ scope = 'default ' , $ scopeCode = null ): bool
@@ -56,7 +57,8 @@ private function getFlag($path, $scope = 'default', $scopeCode = null): bool
56
57
);
57
58
}
58
59
59
- private function getValue ($ path , $ scope = 'default ' , $ scopeCode = null ): mixed
60
+ /** @return mixed */
61
+ private function getValue ($ path , $ scope = 'default ' , $ scopeCode = null )
60
62
{
61
63
return $ this ->scopeConfig ->getValue (
62
64
$ path ,
0 commit comments