Passed
Push — master ( f48571...166e66 )
by Oleksandr
07:53 queued 10s
created

PayoneToGlossaryFacadeBridge   A

Complexity

Total Complexity 14

Size/Duplication

Total Lines 162
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 16
dl 0
loc 162
rs 10
c 0
b 0
f 0
wmc 14

14 Methods

Rating   Name   Duplication   Size   Complexity  
A createAndTouchTranslation() 0 3 1
A createTranslation() 0 3 1
A touchCurrentTranslationForKeyId() 0 3 1
A createKey() 0 3 1
A translateByKeyId() 0 3 1
A getOrCreateKey() 0 3 1
A translate() 0 3 1
A createTranslationForCurrentLocale() 0 3 1
A hasTranslation() 0 3 1
A saveGlossaryKeyTranslations() 0 3 1
A getKeyIdentifier() 0 3 1
A __construct() 0 3 1
A hasKey() 0 3 1
A updateAndTouchTranslation() 0 3 1
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\Payone\Dependency\Facade;
9
10
use Generated\Shared\Transfer\KeyTranslationTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\KeyTranslationTransfer 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...
11
use 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...
12
13
class PayoneToGlossaryFacadeBridge implements PayoneToGlossaryFacadeInterface
14
{
15
    /**
16
     * @var \Spryker\Zed\Glossary\Business\GlossaryFacadeInterface
17
     */
18
    protected $glossaryFacade;
19
20
    /**
21
     * @param \Spryker\Zed\Glossary\Business\GlossaryFacadeInterface $glossaryFacade
22
     */
23
    public function __construct($glossaryFacade)
24
    {
25
        $this->glossaryFacade = $glossaryFacade;
26
    }
27
28
    /**
29
     * @param int $idKey
30
     * @param array $data
31
     *
32
     * @return string
33
     */
34
    public function translateByKeyId($idKey, array $data = [])
35
    {
36
        return $this->glossaryFacade->translateByKeyId($idKey, $data);
37
    }
38
39
    /**
40
     * @param $keyName
41
     * @param array $data
42
     * @param \Generated\Shared\Transfer\LocaleTransfer|null $localeTransfer
43
     *
44
     * @return string
45
     */
46
    public function translate($keyName, array $data = [], ?LocaleTransfer $localeTransfer = null)
47
    {
48
        return $this->glossaryFacade->translate($keyName, $data ,$localeTransfer);
49
    }
50
51
    /**
52
     * @param string $keyName
53
     * @param string $value
54
     * @param bool $isActive
55
     *
56
     * @return \Generated\Shared\Transfer\TranslationTransfer
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\TranslationTransfer 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...
57
     */
58
    public function createTranslationForCurrentLocale($keyName, $value, $isActive = true)
59
    {
60
        return $this->glossaryFacade->createTranslationForCurrentLocale($keyName, $value, $isActive);
61
    }
62
63
    /**
64
     * @param string $keyName
65
     * @param \Generated\Shared\Transfer\LocaleTransfer $locale
66
     * @param string $value
67
     * @param bool $isActive
68
     *
69
     * @return \Generated\Shared\Transfer\TranslationTransfer
70
     */
71
    public function createTranslation($keyName, LocaleTransfer $locale, $value, $isActive = true)
72
    {
73
        return $this->glossaryFacade->createTranslation($keyName, $locale, $value, $isActive);
74
    }
75
76
    /**
77
     * @param string $keyName
78
     * @param \Generated\Shared\Transfer\LocaleTransfer $locale
79
     * @param string $value
80
     * @param bool $isActive
81
     *
82
     * @return \Generated\Shared\Transfer\TranslationTransfer
83
     */
84
    public function createAndTouchTranslation($keyName, LocaleTransfer $locale, $value, $isActive = true)
85
    {
86
        return $this->glossaryFacade->createAndTouchTranslation($keyName, $locale, $value, $isActive);
87
    }
88
89
    /**
90
     * @param string $keyName
91
     *
92
     * @return int
93
     */
94
    public function createKey($keyName)
95
    {
96
        return $this->glossaryFacade->createKey($keyName);
97
    }
98
99
    /**
100
     * @param string $keyName
101
     *
102
     * @return bool
103
     */
104
    public function hasKey($keyName)
105
    {
106
        return $this->glossaryFacade->hasKey($keyName);
107
    }
108
109
    /**
110
     * @api
111
     *
112
     * @param string $keyName
113
     * @param \Generated\Shared\Transfer\LocaleTransfer|null $locale
114
     *
115
     * @return bool
116
     */
117
    public function hasTranslation($keyName, ?LocaleTransfer $locale = null)
118
    {
119
        return $this->glossaryFacade->hasTranslation($keyName, $locale);
120
    }
121
122
    /**
123
     * @param string $keyName
124
     *
125
     * @return int
126
     */
127
    public function getKeyIdentifier($keyName)
128
    {
129
        return $this->glossaryFacade->getKeyIdentifier($keyName);
130
    }
131
132
    /**
133
     * @param int $idKey
134
     *
135
     * @return void
136
     */
137
    public function touchCurrentTranslationForKeyId($idKey)
138
    {
139
        $this->glossaryFacade->touchCurrentTranslationForKeyId($idKey);
140
    }
141
142
    /**
143
     * @param string $keyName
144
     *
145
     * @return int
146
     */
147
    public function getOrCreateKey($keyName)
148
    {
149
        return $this->glossaryFacade->getOrCreateKey($keyName);
150
    }
151
152
    /**
153
     * @param \Generated\Shared\Transfer\KeyTranslationTransfer $keyTranslationTransfer
154
     *
155
     * @return bool
156
     */
157
    public function saveGlossaryKeyTranslations(KeyTranslationTransfer $keyTranslationTransfer)
158
    {
159
        return $this->glossaryFacade->saveGlossaryKeyTranslations($keyTranslationTransfer);
160
    }
161
162
    /**
163
     * @api
164
     *
165
     * @param string $keyName
166
     * @param \Generated\Shared\Transfer\LocaleTransfer $locale
167
     * @param string $value
168
     * @param bool $isActive
169
     *
170
     * @return \Generated\Shared\Transfer\TranslationTransfer
171
     */
172
    public function updateAndTouchTranslation($keyName, LocaleTransfer $locale, $value, $isActive = true)
173
    {
174
        return $this->glossaryFacade->updateAndTouchTranslation($keyName, $locale, $value, $isActive);
175
    }
176
}
177