binary-cube /
carrot-mq
| 1 | <?php |
||||
| 2 | |||||
| 3 | declare(strict_types=1); |
||||
| 4 | |||||
| 5 | namespace BinaryCube\CarrotMQ\Support\Laravel; |
||||
| 6 | |||||
| 7 | use Psr\Log\LoggerInterface; |
||||
| 8 | use BinaryCube\CarrotMQ\CarrotMQ; |
||||
| 9 | use Illuminate\Foundation\Application; |
||||
|
0 ignored issues
–
show
|
|||||
| 10 | use BinaryCube\CarrotMQ\Support\Laravel\Console\Commands as Commands; |
||||
| 11 | |||||
| 12 | use function is_array; |
||||
| 13 | |||||
| 14 | /** |
||||
| 15 | * Class CarrotMQServiceProvider |
||||
| 16 | */ |
||||
| 17 | class CarrotMQServiceProvider extends \Illuminate\Support\ServiceProvider |
||||
|
0 ignored issues
–
show
The type
Illuminate\Support\ServiceProvider was not found. Maybe you did not declare it correctly or list all dependencies?
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. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||||
| 18 | { |
||||
| 19 | |||||
| 20 | /** |
||||
| 21 | * @return void |
||||
| 22 | */ |
||||
| 23 | public function register() |
||||
| 24 | { |
||||
| 25 | $this->publishConfig(); |
||||
| 26 | } |
||||
| 27 | |||||
| 28 | /** |
||||
| 29 | * @return void |
||||
| 30 | */ |
||||
| 31 | public function boot() |
||||
| 32 | { |
||||
| 33 | $this->prepareApp(); |
||||
| 34 | $this->prepareCommands(); |
||||
| 35 | } |
||||
| 36 | |||||
| 37 | /** |
||||
| 38 | * @return void |
||||
| 39 | */ |
||||
| 40 | protected function publishConfig() |
||||
| 41 | { |
||||
| 42 | $this |
||||
| 43 | ->publishes( |
||||
| 44 | [ |
||||
| 45 | $this->getConfigFile() => config_path('carrot_mq.php'), |
||||
|
0 ignored issues
–
show
The function
config_path was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 46 | ] |
||||
| 47 | ); |
||||
| 48 | } |
||||
| 49 | |||||
| 50 | /** |
||||
| 51 | * @return void |
||||
| 52 | */ |
||||
| 53 | protected function prepareApp() |
||||
| 54 | { |
||||
| 55 | $config = config('carrot_mq', []); |
||||
|
0 ignored issues
–
show
The function
config was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 56 | |||||
| 57 | if (! is_array($config)) { |
||||
| 58 | throw new \RuntimeException( |
||||
| 59 | 'Invalid configuration provided for CarrotMQ-Laravel!' |
||||
| 60 | ); |
||||
| 61 | } |
||||
| 62 | |||||
| 63 | $this->app->bind('carrot.mq', function (Application $app) { |
||||
|
0 ignored issues
–
show
The parameter
$app is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. Loading history...
|
|||||
| 64 | return app(CarrotMQ::class); |
||||
|
0 ignored issues
–
show
The function
app was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 65 | }); |
||||
| 66 | |||||
| 67 | $this->app->singleton(CarrotMQ::class, function (Application $app, $arguments) use ($config) { |
||||
|
0 ignored issues
–
show
The parameter
$arguments is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. Loading history...
|
|||||
| 68 | $logger = $app->make(LoggerInterface::class); |
||||
| 69 | $carrot = new CarrotMQ($config, $logger); |
||||
| 70 | |||||
| 71 | return $carrot; |
||||
| 72 | }); |
||||
| 73 | } |
||||
| 74 | |||||
| 75 | /** |
||||
| 76 | * @return void |
||||
| 77 | */ |
||||
| 78 | protected function prepareCommands() |
||||
| 79 | { |
||||
| 80 | if (! $this->app->runningInConsole()) { |
||||
| 81 | return; |
||||
| 82 | } |
||||
| 83 | |||||
| 84 | $this->commands( |
||||
| 85 | [ |
||||
| 86 | Commands\ListCommand::class, |
||||
| 87 | Commands\SetupCommand::class, |
||||
| 88 | Commands\ConsumerCommand::class, |
||||
| 89 | Commands\DeleteAllCommand::class, |
||||
| 90 | Commands\PurgeCommand::class, |
||||
| 91 | Commands\PublisherCommand::class, |
||||
| 92 | ] |
||||
| 93 | ); |
||||
| 94 | } |
||||
| 95 | |||||
| 96 | /** |
||||
| 97 | * @return string |
||||
| 98 | */ |
||||
| 99 | protected function getConfigFile() |
||||
| 100 | { |
||||
| 101 | return (__DIR__ . '/config/carrot_mq.php'); |
||||
| 102 | } |
||||
| 103 | |||||
| 104 | } |
||||
| 105 |
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