addPunchoutCatalogSetupRequestFormExtensionPlugins()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 7
rs 10
1
<?php
2
3
/**
4
 * Copyright © 2016-present Spryker Systems GmbH. All rights reserved.
5
 * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
 */
7
8
namespace SprykerEco\Zed\PunchoutCatalogs;
9
10
use Orm\Zed\CompanyBusinessUnit\Persistence\SpyCompanyBusinessUnitQuery;
0 ignored issues
show
Bug introduced by
The type Orm\Zed\CompanyBusinessU...ompanyBusinessUnitQuery 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 Orm\Zed\CompanyUser\Persistence\SpyCompanyUserQuery;
0 ignored issues
show
Bug introduced by
The type Orm\Zed\CompanyUser\Pers...nce\SpyCompanyUserQuery 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
use Orm\Zed\PunchoutCatalog\Persistence\PgwPunchoutCatalogConnectionCartQuery;
0 ignored issues
show
Bug introduced by
The type Orm\Zed\PunchoutCatalog\...alogConnectionCartQuery 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...
13
use Orm\Zed\PunchoutCatalog\Persistence\PgwPunchoutCatalogConnectionQuery;
0 ignored issues
show
Bug introduced by
The type Orm\Zed\PunchoutCatalog\...tCatalogConnectionQuery 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...
14
use Orm\Zed\PunchoutCatalog\Persistence\PgwPunchoutCatalogConnectionSetupQuery;
0 ignored issues
show
Bug introduced by
The type Orm\Zed\PunchoutCatalog\...logConnectionSetupQuery 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...
15
use Orm\Zed\PunchoutCatalog\Persistence\PgwPunchoutCatalogTransactionQuery;
0 ignored issues
show
Bug introduced by
The type Orm\Zed\PunchoutCatalog\...CatalogTransactionQuery 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...
16
use Spryker\Zed\Kernel\AbstractBundleDependencyProvider;
17
use Spryker\Zed\Kernel\Container;
18
use SprykerEco\Zed\PunchoutCatalogs\Dependency\Facade\PunchoutCatalogsToCompanyBusinessUnitFacadeBridge;
19
use SprykerEco\Zed\PunchoutCatalogs\Dependency\Facade\PunchoutCatalogsToCompanyUserFacadeBridge;
20
use SprykerEco\Zed\PunchoutCatalogs\Dependency\Facade\PunchoutCatalogsToPunchoutCatalogBridge;
21
use SprykerEco\Zed\PunchoutCatalogs\Dependency\Facade\PunchoutCatalogsToVaultFacadeBridge;
22
use SprykerEco\Zed\PunchoutCatalogs\Dependency\Service\PunchoutCatalogsToUtilDateTimeServiceBridge;
23
24
/**
25
 * @method \SprykerEco\Zed\PunchoutCatalogs\PunchoutCatalogsConfig getConfig()
26
 */
27
class PunchoutCatalogsDependencyProvider extends AbstractBundleDependencyProvider
28
{
29
    public const PROPEL_QUERY_PUNCHOUT_CATALOG_CONNECTION = 'PROPEL_QUERY_PUNCHOUT_CATALOG_CONNECTION';
30
    public const PROPEL_QUERY_PUNCHOUT_CATALOG_CONNECTION_SETUP = 'PROPEL_QUERY_PUNCHOUT_CATALOG_CONNECTION_SETUP';
31
    public const PROPEL_QUERY_PUNCHOUT_CATALOG_CONNECTION_CART = 'PROPEL_QUERY_PUNCHOUT_CATALOG_CONNECTION_CART';
32
    public const PROPEL_QUERY_PUNCHOUT_CATALOG_TRANSACTION = 'PROPEL_QUERY_PUNCHOUT_CATALOG_TRANSACTION';
33
    public const PROPEL_QUERY_COMPANY_BUSINESS_UNIT = 'PROPEL_QUERY_COMPANY_BUSINESS_UNIT';
34
    public const PROPEL_QUERY_COMPANY_USER = 'PROPEL_QUERY_COMPANY_USER';
35
36
    public const SERVICE_UTIL_DATE_TIME = 'SERVICE_UTIL_DATE_TIME';
37
38
    public const FACADE_COMPANY_BUSINESS_UNIT = 'FACADE_COMPANY_BUSINESS_UNIT';
39
    public const FACADE_COMPANY_USER = 'FACADE_COMPANY_USER';
40
    public const FACADE_VAULT = 'FACADE_VAULT';
41
    public const FACADE_PUNCHOUT_CATALOG = 'FACADE_PUNCHOUT_CATALOG';
42
43
    public const PLUGINS_PUNCHOUT_CATALOG_CONNECTION_FORMAT = 'PLUGINS_PUNCHOUT_CATALOG_CONNECTION_FORMAT';
44
    public const PLUGINS_PUNCHOUT_CATALOG_CONNECTION_TYPE = 'PLUGINS_PUNCHOUT_CATALOG_CONNECTION_TYPE';
45
    public const PLUGINS_PUNCHOUT_CATALOG_SETUP_REQUEST_FORM_EXTENSION = 'PLUGINS_PUNCHOUT_CATALOG_SETUP_REQUEST_FORM_EXTENSION';
46
47
    /**
48
     * @param \Spryker\Zed\Kernel\Container $container
49
     *
50
     * @return \Spryker\Zed\Kernel\Container
51
     */
52
    public function provideCommunicationLayerDependencies(Container $container): Container
53
    {
54
        $container = parent::provideCommunicationLayerDependencies($container);
55
        $container = $this->addUtilDateTimeService($container);
56
        $container = $this->addPunchoutCatalogConnectionPropelQuery($container);
57
        $container = $this->addPunchoutCatalogConnectionSetupPropelQuery($container);
58
        $container = $this->addPunchoutCatalogConnectionCartPropelQuery($container);
59
        $container = $this->addPunchoutCatalogTransactionPropelQuery($container);
60
        $container = $this->addCompanyBusinessUnitFacade($container);
61
        $container = $this->addCompanyUserFacade($container);
62
        $container = $this->addPunchoutCatalogFacade($container);
63
        $container = $this->addPunchoutCatalogConnectionFormatPlugins($container);
64
        $container = $this->addPunchoutCatalogConnectionTypePlugins($container);
65
        $container = $this->addPunchoutCatalogSetupRequestFormExtensionPlugins($container);
66
67
        return $container;
68
    }
69
70
    /**
71
     * @param \Spryker\Zed\Kernel\Container $container
72
     *
73
     * @return \Spryker\Zed\Kernel\Container
74
     */
75
    public function providePersistenceLayerDependencies(Container $container): Container
76
    {
77
        $container = parent::providePersistenceLayerDependencies($container);
78
        $container = $this->addPunchoutCatalogConnectionPropelQuery($container);
79
        $container = $this->addPunchoutCatalogConnectionSetupPropelQuery($container);
80
        $container = $this->addPunchoutCatalogConnectionCartPropelQuery($container);
81
        $container = $this->addPunchoutCatalogTransactionPropelQuery($container);
82
        $container = $this->addCompanyBusinessUnitPropelQuery($container);
83
        $container = $this->addCompanyUserPropelQuery($container);
84
85
        return $container;
86
    }
87
88
    /**
89
     * @param \Spryker\Zed\Kernel\Container $container
90
     *
91
     * @return \Spryker\Zed\Kernel\Container
92
     */
93
    public function provideBusinessLayerDependencies(Container $container): Container
94
    {
95
        $container = parent::provideBusinessLayerDependencies($container);
96
        $container = $this->addVaultFacade($container);
97
98
        return $container;
99
    }
100
101
    /**
102
     * @param \Spryker\Zed\Kernel\Container $container
103
     *
104
     * @return \Spryker\Zed\Kernel\Container
105
     */
106
    protected function addUtilDateTimeService(Container $container): Container
107
    {
108
        $container->set(static::SERVICE_UTIL_DATE_TIME, function (Container $container) {
109
            return new PunchoutCatalogsToUtilDateTimeServiceBridge(
110
                $container->getLocator()->utilDateTime()->service()
111
            );
112
        });
113
114
        return $container;
115
    }
116
117
    /**
118
     * @param \Spryker\Zed\Kernel\Container $container
119
     *
120
     * @return \Spryker\Zed\Kernel\Container
121
     */
122
    protected function addPunchoutCatalogConnectionPropelQuery(Container $container): Container
123
    {
124
        $container->set(static::PROPEL_QUERY_PUNCHOUT_CATALOG_CONNECTION, function () {
125
            return PgwPunchoutCatalogConnectionQuery::create();
126
        });
127
128
        return $container;
129
    }
130
131
    /**
132
     * @param \Spryker\Zed\Kernel\Container $container
133
     *
134
     * @return \Spryker\Zed\Kernel\Container
135
     */
136
    protected function addPunchoutCatalogConnectionSetupPropelQuery(Container $container): Container
137
    {
138
        $container->set(static::PROPEL_QUERY_PUNCHOUT_CATALOG_CONNECTION_SETUP, function () {
139
            return PgwPunchoutCatalogConnectionSetupQuery::create();
140
        });
141
142
        return $container;
143
    }
144
145
    /**
146
     * @param \Spryker\Zed\Kernel\Container $container
147
     *
148
     * @return \Spryker\Zed\Kernel\Container
149
     */
150
    protected function addPunchoutCatalogConnectionCartPropelQuery(Container $container): Container
151
    {
152
        $container->set(static::PROPEL_QUERY_PUNCHOUT_CATALOG_CONNECTION_CART, function () {
153
            return PgwPunchoutCatalogConnectionCartQuery::create();
154
        });
155
156
        return $container;
157
    }
158
159
    /**
160
     * @param \Spryker\Zed\Kernel\Container $container
161
     *
162
     * @return \Spryker\Zed\Kernel\Container
163
     */
164
    protected function addPunchoutCatalogTransactionPropelQuery(Container $container): Container
165
    {
166
        $container->set(static::PROPEL_QUERY_PUNCHOUT_CATALOG_TRANSACTION, function () {
167
            return PgwPunchoutCatalogTransactionQuery::create();
168
        });
169
170
        return $container;
171
    }
172
173
    /**
174
     * @param \Spryker\Zed\Kernel\Container $container
175
     *
176
     * @return \Spryker\Zed\Kernel\Container
177
     */
178
    protected function addCompanyBusinessUnitFacade(Container $container): Container
179
    {
180
        $container->set(static::FACADE_COMPANY_BUSINESS_UNIT, function (Container $container) {
181
            return new PunchoutCatalogsToCompanyBusinessUnitFacadeBridge(
182
                $container->getLocator()->companyBusinessUnit()->facade()
183
            );
184
        });
185
186
        return $container;
187
    }
188
189
    /**
190
     * @param \Spryker\Zed\Kernel\Container $container
191
     *
192
     * @return \Spryker\Zed\Kernel\Container
193
     */
194
    protected function addCompanyUserFacade(Container $container): Container
195
    {
196
        $container->set(static::FACADE_COMPANY_USER, function (Container $container) {
197
            return new PunchoutCatalogsToCompanyUserFacadeBridge(
198
                $container->getLocator()->companyUser()->facade()
199
            );
200
        });
201
202
        return $container;
203
    }
204
205
    /**
206
     * @param \Spryker\Zed\Kernel\Container $container
207
     *
208
     * @return \Spryker\Zed\Kernel\Container
209
     */
210
    protected function addVaultFacade(Container $container): Container
211
    {
212
        $container->set(static::FACADE_VAULT, function (Container $container) {
213
            return new PunchoutCatalogsToVaultFacadeBridge(
214
                $container->getLocator()->vault()->facade()
215
            );
216
        });
217
218
        return $container;
219
    }
220
221
    /**
222
     * @param \Spryker\Zed\Kernel\Container $container
223
     *
224
     * @return \Spryker\Zed\Kernel\Container
225
     */
226
    protected function addPunchoutCatalogFacade(Container $container): Container
227
    {
228
        $container->set(static::FACADE_PUNCHOUT_CATALOG, function (Container $container) {
229
            return new PunchoutCatalogsToPunchoutCatalogBridge(
230
                $container->getLocator()->punchoutCatalog()->facade()
231
            );
232
        });
233
234
        return $container;
235
    }
236
237
    /**
238
     * @param \Spryker\Zed\Kernel\Container $container
239
     *
240
     * @return \Spryker\Zed\Kernel\Container
241
     */
242
    protected function addPunchoutCatalogConnectionFormatPlugins(Container $container): Container
243
    {
244
        $container->set(static::PLUGINS_PUNCHOUT_CATALOG_CONNECTION_FORMAT, function (Container $container) {
0 ignored issues
show
Unused Code introduced by
The parameter $container is not used and could be removed. ( Ignorable by Annotation )

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

244
        $container->set(static::PLUGINS_PUNCHOUT_CATALOG_CONNECTION_FORMAT, function (/** @scrutinizer ignore-unused */ Container $container) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
245
            return $this->getPunchoutCatalogConnectionFormatPlugins();
246
        });
247
248
        return $container;
249
    }
250
251
    /**
252
     * @param \Spryker\Zed\Kernel\Container $container
253
     *
254
     * @return \Spryker\Zed\Kernel\Container
255
     */
256
    protected function addPunchoutCatalogConnectionTypePlugins(Container $container): Container
257
    {
258
        $container->set(static::PLUGINS_PUNCHOUT_CATALOG_CONNECTION_TYPE, function (Container $container) {
0 ignored issues
show
Unused Code introduced by
The parameter $container is not used and could be removed. ( Ignorable by Annotation )

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

258
        $container->set(static::PLUGINS_PUNCHOUT_CATALOG_CONNECTION_TYPE, function (/** @scrutinizer ignore-unused */ Container $container) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
259
            return $this->getPunchoutCatalogConnectionTypePlugins();
260
        });
261
262
        return $container;
263
    }
264
265
    /**
266
     * @param \Spryker\Zed\Kernel\Container $container
267
     *
268
     * @return \Spryker\Zed\Kernel\Container
269
     */
270
    protected function addPunchoutCatalogSetupRequestFormExtensionPlugins(Container $container): Container
271
    {
272
        $container->set(static::PLUGINS_PUNCHOUT_CATALOG_SETUP_REQUEST_FORM_EXTENSION, function (Container $container) {
0 ignored issues
show
Unused Code introduced by
The parameter $container is not used and could be removed. ( Ignorable by Annotation )

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

272
        $container->set(static::PLUGINS_PUNCHOUT_CATALOG_SETUP_REQUEST_FORM_EXTENSION, function (/** @scrutinizer ignore-unused */ Container $container) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
273
            return $this->getPunchoutCatalogSetupRequestFormExtensionPlugins();
274
        });
275
276
        return $container;
277
    }
278
279
    /**
280
     * @return \SprykerEco\Zed\PunchoutCatalogs\Dependency\Plugin\PunchoutCatalogConnectionFormatPluginInterface[]
281
     */
282
    protected function getPunchoutCatalogConnectionFormatPlugins(): array
283
    {
284
        return [];
285
    }
286
287
    /**
288
     * @return \SprykerEco\Zed\PunchoutCatalogs\Dependency\Plugin\PunchoutCatalogConnectionTypePluginInterface[]
289
     */
290
    protected function getPunchoutCatalogConnectionTypePlugins(): array
291
    {
292
        return [];
293
    }
294
295
    /**
296
     * @return \SprykerEco\Zed\PunchoutCatalogs\Dependency\Plugin\PunchoutCatalogSetupRequestFormExtensionPluginInterface[]
297
     */
298
    protected function getPunchoutCatalogSetupRequestFormExtensionPlugins(): array
299
    {
300
        return [];
301
    }
302
303
    /**
304
     * @param \Spryker\Zed\Kernel\Container $container
305
     *
306
     * @return \Spryker\Zed\Kernel\Container
307
     */
308
    protected function addCompanyBusinessUnitPropelQuery(Container $container): Container
309
    {
310
        $container->set(static::PROPEL_QUERY_COMPANY_BUSINESS_UNIT, $container->factory(function (Container $container) {
0 ignored issues
show
Unused Code introduced by
The parameter $container is not used and could be removed. ( Ignorable by Annotation )

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

310
        $container->set(static::PROPEL_QUERY_COMPANY_BUSINESS_UNIT, $container->factory(function (/** @scrutinizer ignore-unused */ Container $container) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
311
            return SpyCompanyBusinessUnitQuery::create();
312
        }));
313
314
        return $container;
315
    }
316
317
    /**
318
     * @param \Spryker\Zed\Kernel\Container $container
319
     *
320
     * @return \Spryker\Zed\Kernel\Container
321
     */
322
    protected function addCompanyUserPropelQuery(Container $container): Container
323
    {
324
        $container->set(static::PROPEL_QUERY_COMPANY_USER, $container->factory(function (Container $container) {
0 ignored issues
show
Unused Code introduced by
The parameter $container is not used and could be removed. ( Ignorable by Annotation )

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

324
        $container->set(static::PROPEL_QUERY_COMPANY_USER, $container->factory(function (/** @scrutinizer ignore-unused */ Container $container) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
325
            return SpyCompanyUserQuery::create();
326
        }));
327
328
        return $container;
329
    }
330
}
331