1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace jeremykenedy\LaravelPackagist; |
4
|
|
|
|
5
|
|
|
use Illuminate\Foundation\AliasLoader; |
|
|
|
|
6
|
|
|
use Illuminate\Support\ServiceProvider; |
|
|
|
|
7
|
|
|
|
8
|
|
|
class LaravelPackagistServiceProvider extends ServiceProvider |
9
|
|
|
{ |
10
|
|
|
private $_packageTag = 'laravelpackagist'; |
11
|
|
|
|
12
|
|
|
/** |
13
|
|
|
* Indicates if loading of the provider is deferred. |
14
|
|
|
* |
15
|
|
|
* @var bool |
16
|
|
|
*/ |
17
|
|
|
protected $defer = false; |
18
|
|
|
|
19
|
|
|
/** |
20
|
|
|
* Bootstrap the application services. |
21
|
|
|
* |
22
|
|
|
* @return void |
23
|
|
|
*/ |
24
|
|
|
public function boot() |
25
|
|
|
{ |
26
|
|
|
$this->loadTranslationsFrom(__DIR__.'/resources/lang/', $this->_packageTag); |
27
|
|
|
} |
28
|
|
|
|
29
|
|
|
/** |
30
|
|
|
* Register the application services. |
31
|
|
|
* |
32
|
|
|
* @return void |
33
|
|
|
*/ |
34
|
|
|
public function register() |
35
|
|
|
{ |
36
|
|
|
$this->packageRegistration(); |
37
|
|
|
$this->mergeConfigFrom(__DIR__.'/config/'.$this->_packageTag.'.php', $this->_packageTag); |
38
|
|
|
$this->publishFiles(); |
39
|
|
|
} |
40
|
|
|
|
41
|
|
|
/** |
42
|
|
|
* Package Registration. |
43
|
|
|
* |
44
|
|
|
* @return void |
45
|
|
|
*/ |
46
|
|
|
private function packageRegistration() |
47
|
|
|
{ |
48
|
|
|
$this->app->make('jeremykenedy\LaravelPackagist\App\Services\PackagistApiServices'); |
49
|
|
|
AliasLoader::getInstance()->alias('PackagistApiServices', \jeremykenedy\LaravelPackagist\App\Services\PackagistApiServices::class); |
50
|
|
|
$this->app->singleton(jeremykenedy\LaravelPackagist\App\Services\PackagistApiServices::class, function () { |
|
|
|
|
51
|
|
|
return new jeremykenedy\LaravelPackagist\App\Services\PackagistApiServices(); |
52
|
|
|
}); |
53
|
|
|
$this->app->alias(jeremykenedy\LaravelPackagist\App\Services\PackagistApiServices::class, $this->_packageTag); |
54
|
|
|
} |
55
|
|
|
|
56
|
|
|
/** |
57
|
|
|
* Get the services provided by the provider. |
58
|
|
|
* |
59
|
|
|
* @return array |
60
|
|
|
*/ |
61
|
|
|
public function provides() |
62
|
|
|
{ |
63
|
|
|
return [$this->_packageTag]; |
64
|
|
|
} |
65
|
|
|
|
66
|
|
|
/** |
67
|
|
|
* Publish files for Laravel Blocker. |
68
|
|
|
* |
69
|
|
|
* @return void |
70
|
|
|
*/ |
71
|
|
|
private function publishFiles() |
72
|
|
|
{ |
73
|
|
|
$this->publishes([ |
74
|
|
|
__DIR__.'/config/'.$this->_packageTag.'.php' => base_path('config/'.$this->_packageTag.'.php'), |
|
|
|
|
75
|
|
|
], $this->_packageTag.'-config'); |
76
|
|
|
|
77
|
|
|
$this->publishes([ |
78
|
|
|
__DIR__.'/resources/lang' => base_path('resources/lang/vendor/'.$this->_packageTag), |
79
|
|
|
], $this->_packageTag.'-lang'); |
80
|
|
|
} |
81
|
|
|
} |
82
|
|
|
|
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