1
|
|
|
<?php declare(strict_types=1); |
2
|
|
|
|
3
|
|
|
namespace DanielPieper\MergeReminder\ServiceProvider; |
4
|
|
|
|
5
|
|
|
use Http\Adapter\Guzzle6\Client; |
|
|
|
|
6
|
|
|
use Http\Client\HttpClient; |
7
|
|
|
use League\Container\Container; |
8
|
|
|
use League\Container\ServiceProvider\AbstractServiceProvider; |
9
|
|
|
use Psr\Cache\CacheItemPoolInterface; |
10
|
|
|
use Psr\Log\LoggerAwareInterface; |
11
|
|
|
use Psr\Log\LoggerInterface; |
12
|
|
|
use Symfony\Component\Cache\Adapter\FilesystemAdapter; |
13
|
|
|
use Symfony\Component\Console\Logger\ConsoleLogger; |
14
|
|
|
use Symfony\Component\Console\Output\ConsoleOutput; |
15
|
|
|
use Symfony\Component\Console\Output\OutputInterface; |
16
|
|
|
|
17
|
|
|
class BaseServiceProvider extends AbstractServiceProvider |
18
|
|
|
{ |
19
|
|
|
/** |
20
|
|
|
* {@inheritdoc} |
21
|
|
|
*/ |
22
|
|
|
protected $provides = [ |
23
|
|
|
OutputInterface::class, |
24
|
|
|
LoggerInterface::class, |
25
|
|
|
CacheItemPoolInterface::class, |
26
|
|
|
HttpClient::class, |
27
|
|
|
]; |
28
|
|
|
|
29
|
|
|
/** |
30
|
|
|
* {@inheritdoc} |
31
|
|
|
*/ |
32
|
|
|
public function register() |
33
|
|
|
{ |
34
|
|
|
/** @var Container $container */ |
35
|
|
|
$container = $this->getContainer(); |
36
|
|
|
|
37
|
|
|
$container->share(OutputInterface::class, ConsoleOutput::class); |
|
|
|
|
38
|
|
|
|
39
|
|
|
$container->share(LoggerInterface::class, ConsoleLogger::class) |
40
|
|
|
->addArgument(OutputInterface::class); |
41
|
|
|
|
42
|
|
|
$container->inflector(LoggerAwareInterface::class) |
43
|
|
|
->invokeMethod('setLogger', [LoggerInterface::class]); |
44
|
|
|
|
45
|
|
|
$container->share(CacheItemPoolInterface::class, FilesystemAdapter::class) |
46
|
|
|
->addArguments([ |
47
|
|
|
'namespace' => 'mrcli', |
48
|
|
|
'defaultLifetime' => 0, |
49
|
|
|
'directory' => null, |
50
|
|
|
]); |
51
|
|
|
|
52
|
|
|
$container->share(HttpClient::class, Client::class); |
53
|
|
|
} |
54
|
|
|
} |
55
|
|
|
|
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