1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Sarahman\HttpRequestApiLog; |
4
|
|
|
|
5
|
|
|
use Illuminate\Foundation\Application as IlluminateApplication; |
|
|
|
|
6
|
|
|
use Illuminate\Support\ServiceProvider; |
7
|
|
|
|
8
|
|
|
class HttpRequestApiLogServiceProvider extends ServiceProvider |
9
|
|
|
{ |
10
|
|
|
/** |
11
|
|
|
* Indicates if loading of the provider is deferred. |
12
|
|
|
* |
13
|
|
|
* @var bool |
14
|
|
|
*/ |
15
|
|
|
protected $defer = false; |
16
|
|
|
|
17
|
|
|
/** |
18
|
|
|
* Actual provider based on Laravel version. |
19
|
|
|
* |
20
|
|
|
* @var \Illuminate\Support\ServiceProvider |
21
|
|
|
*/ |
22
|
|
|
protected $provider; |
23
|
|
|
|
24
|
|
|
/** |
25
|
|
|
* Create a new service provider instance. |
26
|
|
|
* |
27
|
|
|
* @param \Illuminate\Contracts\Foundation\Application $app |
28
|
|
|
* |
29
|
|
|
* @return void |
30
|
|
|
*/ |
31
|
|
|
public function __construct($app) |
32
|
|
|
{ |
33
|
|
|
parent::__construct($app); |
34
|
|
|
|
35
|
|
|
$this->provider = $this->getProvider(); |
36
|
|
|
} |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* Bootstrap the application events. |
40
|
|
|
* |
41
|
|
|
* @return void |
42
|
|
|
*/ |
43
|
|
|
public function boot() |
44
|
|
|
{ |
45
|
|
|
if (method_exists($this->provider, 'boot')) { |
46
|
|
|
return $this->provider->boot(); |
|
|
|
|
47
|
|
|
} |
48
|
|
|
} |
49
|
|
|
|
50
|
|
|
/** |
51
|
|
|
* Register the service provider. |
52
|
|
|
* |
53
|
|
|
* @return void |
54
|
|
|
*/ |
55
|
|
|
public function register() |
56
|
|
|
{ |
57
|
|
|
return $this->provider->register(); |
|
|
|
|
58
|
|
|
} |
59
|
|
|
|
60
|
|
|
/** |
61
|
|
|
* Return ServiceProvider according to Laravel version. |
62
|
|
|
* |
63
|
|
|
* @return \Illuminate\Support\ServiceProvider |
64
|
|
|
*/ |
65
|
|
|
private function getProvider() |
66
|
|
|
{ |
67
|
|
|
if (version_compare(IlluminateApplication::VERSION, '5.0', '<')) { |
68
|
|
|
$provider = '\Sarahman\HttpRequestApiLog\ServiceProviderForLaravel4'; |
69
|
|
|
} else { |
70
|
|
|
$provider = '\Sarahman\HttpRequestApiLog\ServiceProviderForLaravelRecent'; |
71
|
|
|
} |
72
|
|
|
|
73
|
|
|
return new $provider($this->app); |
74
|
|
|
} |
75
|
|
|
|
76
|
|
|
/** |
77
|
|
|
* Get the services provided by the provider. |
78
|
|
|
* |
79
|
|
|
* @return array |
80
|
|
|
*/ |
81
|
|
|
public function provides() |
82
|
|
|
{ |
83
|
|
|
return ['http-request-api-log']; |
84
|
|
|
} |
85
|
|
|
} |
86
|
|
|
|
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