FactFinderSdkToLocaleBridge::getLocaleByCode()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * MIT License
5
 * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
 */
7
8
namespace SprykerEco\Zed\FactFinderSdk\Dependency\Facade;
9
10
/**
11
 * @SuppressWarnings(BridgeNameRule)
12
 */
13
class FactFinderSdkToLocaleBridge implements FactFinderSdkToLocaleInterface
14
{
15
    /**
16
     * @var \Spryker\Zed\Locale\Business\LocaleFacadeInterface
17
     */
18
    protected $localeFacade;
19
20
    /**
21
     * @param \Spryker\Zed\Locale\Business\LocaleFacadeInterface $localeFacade
22
     */
23
    public function __construct($localeFacade)
24
    {
25
        $this->localeFacade = $localeFacade;
26
    }
27
28
    /**
29
     * @return \Generated\Shared\Transfer\LocaleTransfer[]
30
     */
31
    public function getLocaleCollection()
32
    {
33
        return $this->localeFacade
34
            ->getLocaleCollection();
35
    }
36
37
    /**
38
     * @param string $localeName
39
     *
40
     * @return bool
41
     */
42
    public function hasLocale($localeName)
43
    {
44
        return $this->localeFacade
45
            ->hasLocale($localeName);
46
    }
47
48
    /**
49
     * @param string $localeName
50
     *
51
     * @return \Generated\Shared\Transfer\LocaleTransfer
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\LocaleTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
52
     */
53
    public function getLocale($localeName)
54
    {
55
        return $this->localeFacade
56
            ->getLocale($localeName);
57
    }
58
59
    /**
60
     * @param string $localeCode
61
     *
62
     * @return \Generated\Shared\Transfer\LocaleTransfer
63
     */
64
    public function getLocaleByCode($localeCode)
65
    {
66
        return $this->localeFacade
0 ignored issues
show
Deprecated Code introduced by
The function Spryker\Zed\Locale\Busin...face::getLocaleByCode() has been deprecated: Use {@link \Spryker\Zed\Locale\Business\LocaleFacadeInterface::getLocale()} instead. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

66
        return /** @scrutinizer ignore-deprecated */ $this->localeFacade

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
67
            ->getLocaleByCode($localeCode);
68
    }
69
70
    /**
71
     * @param int $idLocale
72
     *
73
     * @return \Generated\Shared\Transfer\LocaleTransfer
74
     */
75
    public function getLocaleById($idLocale)
76
    {
77
        return $this->localeFacade
78
            ->getLocaleById($idLocale);
79
    }
80
81
    /**
82
     * @return string
83
     */
84
    public function getCurrentLocaleName()
85
    {
86
        return $this->localeFacade
87
            ->getCurrentLocaleName();
88
    }
89
90
    /**
91
     * @return array
92
     */
93
    public function getAvailableLocales()
94
    {
95
        return $this->localeFacade
96
            ->getAvailableLocales();
97
    }
98
99
    /**
100
     * @return \Generated\Shared\Transfer\LocaleTransfer
101
     */
102
    public function getCurrentLocale()
103
    {
104
        return $this->localeFacade
105
            ->getCurrentLocale();
106
    }
107
108
    /**
109
     * @param string $localeName
110
     *
111
     * @return \Generated\Shared\Transfer\LocaleTransfer
112
     */
113
    public function createLocale($localeName)
114
    {
115
        return $this->localeFacade
116
            ->createLocale($localeName);
117
    }
118
119
    /**
120
     * @param string $localeName
121
     *
122
     * @return void
123
     */
124
    public function deleteLocale($localeName)
125
    {
126
        $this->localeFacade
127
            ->deleteLocale($localeName);
128
    }
129
130
    /**
131
     * @return void
132
     */
133
    public function install()
134
    {
135
        $this->localeFacade
136
            ->install();
137
    }
138
}
139