MySqlPassportProvider   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 42
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 42
loc 42
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getContainerConfigurators() 6 6 1
A getMigrations() 6 6 1
A getRouteConfigurators() 6 6 1
A getMiddleware() 6 6 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 declare(strict_types=1);
2
3
namespace Limoncello\Passport\Package;
4
5
/**
6
 * Copyright 2015-2019 [email protected]
7
 *
8
 * Licensed under the Apache License, Version 2.0 (the "License");
9
 * you may not use this file except in compliance with the License.
10
 * You may obtain a copy of the License at
11
 *
12
 * http://www.apache.org/licenses/LICENSE-2.0
13
 *
14
 * Unless required by applicable law or agreed to in writing, software
15
 * distributed under the License is distributed on an "AS IS" BASIS,
16
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
 * See the License for the specific language governing permissions and
18
 * limitations under the License.
19
 */
20
21
use Limoncello\Contracts\Provider\ProvidesContainerConfiguratorsInterface as CCI;
22
use Limoncello\Contracts\Provider\ProvidesMigrationsInterface as MI;
23
use Limoncello\Contracts\Provider\ProvidesRouteConfiguratorsInterface as CI;
24
use Limoncello\Contracts\Provider\ProvidesMiddlewareInterface as MWI;
25
use Limoncello\Passport\Authentication\PassportMiddleware;
26
27
/**
28
 * @package Limoncello\Passport
29
 */
30 View Code Duplication
class MySqlPassportProvider implements CCI, MI, CI, MWI
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...
31
{
32
    /**
33
     * @inheritdoc
34
     */
35 1
    public static function getContainerConfigurators(): array
36
    {
37
        return [
38 1
            MySqlPassportContainerConfigurator::class,
39
        ];
40
    }
41
42
    /**
43
     * @inheritdoc
44
     */
45 1
    public static function getMigrations(): array
46
    {
47
        return [
48 1
            MySqlPassportMigration::class,
49
        ];
50
    }
51
52
    /**
53
     * @inheritdoc
54
     */
55 1
    public static function getRouteConfigurators(): array
56
    {
57
        return [
58 1
            PassportRoutesConfigurator::class,
59
        ];
60
    }
61
62
    /**
63
     * @inheritdoc
64
     */
65 1
    public static function getMiddleware(): array
66
    {
67
        return [
68 1
            PassportMiddleware::class,
69
        ];
70
    }
71
}
72