Passed
Push — master ( 03c468...179943 )
by Darko
11:56
created

CategorizationServiceProvider::register()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 9
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace App\Providers;
4
5
use App\Services\Categorization\CategorizationPipeline;
6
use App\Services\Categorization\Categorizers;
7
use App\Services\Categorization\Contracts\CategorizerInterface;
8
use Illuminate\Support\ServiceProvider;
9
10
class CategorizationServiceProvider extends ServiceProvider
11
{
12
    /**
13
     * Register services.
14
     */
15
    public function register(): void
16
    {
17
        // Register the pipeline as a singleton
18
        $this->app->singleton(CategorizationPipeline::class, function ($app) {
0 ignored issues
show
Unused Code introduced by
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 ignore-unused  annotation

18
        $this->app->singleton(CategorizationPipeline::class, function (/** @scrutinizer ignore-unused */ $app) {

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...
19
            return CategorizationPipeline::createDefault();
20
        });
21
22
        // Alias for easier access
23
        $this->app->alias(CategorizationPipeline::class, 'categorization');
24
    }
25
26
    /**
27
     * Bootstrap services.
28
     */
29
    public function boot(): void
30
    {
31
        //
32
    }
33
}
34
35