Completed
Push — master ( 8a52a0...d62aa7 )
by Linus
15:16 queued 05:19
created

AwsZipStreamServiceProvider   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 45
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 45
loc 45
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 3 3 1
A register() 11 11 1
A provides() 4 4 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
3
namespace App\Providers;
4
5
use Illuminate\Support\ServiceProvider;
6
use limenet\S3BucketStreamZip\S3BucketStreamZip;
7
8 View Code Duplication
class AwsZipStreamServiceProvider extends ServiceProvider
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
9
{
10
    /**
11
     * Indicates if loading of the provider is deferred.
12
     *
13
     * @var bool
14
     */
15
    protected $defer = true;
16
17
    /**
18
     * Bootstrap the application services.
19
     *
20
     * @return void
21
     */
22
    public function boot()
23
    {
24
    }
25
26
    /**
27
     * Register the application services.
28
     *
29
     * @return void
30
     */
31
    public function register()
32
    {
33
        $this->app->bind(S3BucketStreamZip::class, function ($_) {
0 ignored issues
show
Unused Code introduced by
The parameter $_ is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
34
            return new S3BucketStreamZip([
35
                'key'     => config('services.s3.key'),
36
                'secret'  => config('services.s3.secret'),
37
                'region'  => config('services.s3.region'),
38
                'version' => config('services.s3.version'),
39
            ]);
40
        });
41
    }
42
43
    /**
44
     * Get the services provided by the provider.
45
     *
46
     * @return array
47
     */
48
    public function provides()
49
    {
50
        return [S3BucketStreamZip::class];
51
    }
52
}
53