|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* MIT License |
|
5
|
|
|
* For full license information, please view the LICENSE file that was distributed with this source code. |
|
6
|
|
|
*/ |
|
7
|
|
|
|
|
8
|
|
|
namespace SprykerEco\Zed\CrefoPayApi; |
|
9
|
|
|
|
|
10
|
|
|
use Spryker\Zed\Kernel\AbstractBundleDependencyProvider; |
|
|
|
|
|
|
11
|
|
|
use Spryker\Zed\Kernel\Container; |
|
|
|
|
|
|
12
|
|
|
use SprykerEco\Zed\CrefoPayApi\Dependency\External\Guzzle\CrefoPayApiGuzzleHttpClientAdapter; |
|
13
|
|
|
use SprykerEco\Zed\CrefoPayApi\Dependency\Service\CrefoPayApiToUtilEncodingServiceBridge; |
|
14
|
|
|
|
|
15
|
|
|
class CrefoPayApiDependencyProvider extends AbstractBundleDependencyProvider |
|
16
|
|
|
{ |
|
17
|
|
|
public const SERVICE_UTIL_ENCODING = 'SERVICE_UTIL_ENCODING'; |
|
18
|
|
|
public const SERVICE_CREFO_PAY_API = 'SERVICE_CREFO_PAY_API'; |
|
19
|
|
|
|
|
20
|
|
|
public const CREFO_PAY_API_HTTP_CLIENT = 'CREFO_PAY_API_HTTP_CLIENT'; |
|
21
|
|
|
|
|
22
|
|
|
/** |
|
23
|
|
|
* @param \Spryker\Zed\Kernel\Container $container |
|
24
|
|
|
* |
|
25
|
|
|
* @return \Spryker\Zed\Kernel\Container |
|
26
|
|
|
*/ |
|
27
|
|
|
public function provideBusinessLayerDependencies(Container $container): Container |
|
28
|
|
|
{ |
|
29
|
|
|
$container = parent::provideBusinessLayerDependencies($container); |
|
30
|
|
|
$container = $this->addUtilEncodingService($container); |
|
31
|
|
|
$container = $this->addCrefoPayApiService($container); |
|
32
|
|
|
$container = $this->addCrefoPayApiHttpClient($container); |
|
33
|
|
|
|
|
34
|
|
|
return $container; |
|
35
|
|
|
} |
|
36
|
|
|
|
|
37
|
|
|
/** |
|
38
|
|
|
* @param \Spryker\Zed\Kernel\Container $container |
|
39
|
|
|
* |
|
40
|
|
|
* @return \Spryker\Zed\Kernel\Container |
|
41
|
|
|
*/ |
|
42
|
|
|
protected function addUtilEncodingService(Container $container): Container |
|
43
|
|
|
{ |
|
44
|
|
|
$container[static::SERVICE_UTIL_ENCODING] = function (Container $container) { |
|
45
|
|
|
return new CrefoPayApiToUtilEncodingServiceBridge($container->getLocator()->utilEncoding()->service()); |
|
46
|
|
|
}; |
|
47
|
|
|
|
|
48
|
|
|
return $container; |
|
49
|
|
|
} |
|
50
|
|
|
|
|
51
|
|
|
/** |
|
52
|
|
|
* @param \Spryker\Zed\Kernel\Container $container |
|
53
|
|
|
* |
|
54
|
|
|
* @return \Spryker\Zed\Kernel\Container |
|
55
|
|
|
*/ |
|
56
|
|
|
protected function addCrefoPayApiService(Container $container): Container |
|
57
|
|
|
{ |
|
58
|
|
|
$container[static::SERVICE_CREFO_PAY_API] = function (Container $container) { |
|
59
|
|
|
return $container->getLocator()->crefoPayApi()->service(); |
|
60
|
|
|
}; |
|
61
|
|
|
|
|
62
|
|
|
return $container; |
|
63
|
|
|
} |
|
64
|
|
|
|
|
65
|
|
|
/** |
|
66
|
|
|
* @param \Spryker\Zed\Kernel\Container $container |
|
67
|
|
|
* |
|
68
|
|
|
* @return \Spryker\Zed\Kernel\Container |
|
69
|
|
|
*/ |
|
70
|
|
|
protected function addCrefoPayApiHttpClient(Container $container): Container |
|
71
|
|
|
{ |
|
72
|
|
|
$container[static::CREFO_PAY_API_HTTP_CLIENT] = function () { |
|
73
|
|
|
return new CrefoPayApiGuzzleHttpClientAdapter(); |
|
74
|
|
|
}; |
|
75
|
|
|
|
|
76
|
|
|
return $container; |
|
77
|
|
|
} |
|
78
|
|
|
} |
|
79
|
|
|
|
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:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths