1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace AlecRabbit\Spinner\Root\A; |
6
|
|
|
|
7
|
|
|
use AlecRabbit\Spinner\Container\A\AContainerEnclosure; |
|
|
|
|
8
|
|
|
use AlecRabbit\Spinner\Core\Contract\IDriver; |
9
|
|
|
use AlecRabbit\Spinner\Core\Contract\IDriverProvider; |
10
|
|
|
use AlecRabbit\Spinner\Core\Contract\ISpinner; |
11
|
|
|
use AlecRabbit\Spinner\Core\Factory\Contract\ISpinnerFactory; |
12
|
|
|
use AlecRabbit\Spinner\Core\Loop\Contract\ILoop; |
13
|
|
|
use AlecRabbit\Spinner\Core\Loop\Contract\ILoopProvider; |
14
|
|
|
use AlecRabbit\Spinner\Core\Settings\Contract\ISettings; |
15
|
|
|
use AlecRabbit\Spinner\Core\Settings\Contract\ISettingsProvider; |
16
|
|
|
use AlecRabbit\Spinner\Core\Settings\Contract\ISpinnerSettings; |
17
|
|
|
use AlecRabbit\Spinner\Exception\DomainException; |
18
|
|
|
|
19
|
|
|
abstract class AFacade extends AContainerEnclosure |
20
|
|
|
{ |
21
|
|
|
public static function getLoop(): ILoop |
22
|
|
|
{ |
23
|
|
|
$loopProvider = self::getLoopProvider(); |
24
|
|
|
|
25
|
|
|
if ($loopProvider->hasLoop()) { |
26
|
|
|
return $loopProvider->getLoop(); |
27
|
|
|
} |
28
|
|
|
|
29
|
|
|
throw new DomainException('Event loop is unavailable.'); |
30
|
|
|
} |
31
|
|
|
|
32
|
|
|
protected static function getLoopProvider(): ILoopProvider |
33
|
|
|
{ |
34
|
|
|
return self::getContainer()->get(ILoopProvider::class); |
35
|
|
|
} |
36
|
|
|
|
37
|
|
|
public static function createSpinner(?ISpinnerSettings $spinnerSettings = null): ISpinner |
38
|
|
|
{ |
39
|
|
|
$spinner = self::getSpinnerFactory()->create($spinnerSettings); |
40
|
|
|
|
41
|
|
|
if ($spinnerSettings?->isAutoAttach() ?? true) { |
42
|
|
|
self::getDriver()->add($spinner); |
43
|
|
|
} |
44
|
|
|
|
45
|
|
|
return $spinner; |
46
|
|
|
} |
47
|
|
|
|
48
|
|
|
protected static function getSpinnerFactory(): ISpinnerFactory |
49
|
|
|
{ |
50
|
|
|
return self::getContainer()->get(ISpinnerFactory::class); |
51
|
|
|
} |
52
|
|
|
|
53
|
|
|
public static function getDriver(): IDriver |
54
|
|
|
{ |
55
|
|
|
return self::getDriverProvider()->getDriver(); |
56
|
|
|
} |
57
|
|
|
|
58
|
|
|
protected static function getDriverProvider(): IDriverProvider |
59
|
|
|
{ |
60
|
|
|
return self::getContainer()->get(IDriverProvider::class); |
61
|
|
|
} |
62
|
|
|
|
63
|
|
|
public static function getSettings(): ISettings |
64
|
|
|
{ |
65
|
|
|
return self::getSettingsProvider()->getUserSettings(); |
66
|
|
|
} |
67
|
|
|
|
68
|
|
|
protected static function getSettingsProvider(): ISettingsProvider |
69
|
|
|
{ |
70
|
|
|
return self::getContainer()->get(ISettingsProvider::class); |
71
|
|
|
} |
72
|
|
|
} |
73
|
|
|
|
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