CompositeUnionResolver   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 50 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 9
loc 18
c 0
b 0
f 0
wmc 2
lcom 1
cbo 2
ccs 0
cts 5
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A resolve() 9 9 2

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
/*
4
 * This file is part of the LightSAML-Core package.
5
 *
6
 * (c) Milos Tomic <[email protected]>
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace LightSaml\Resolver\Credential;
13
14
use LightSaml\Credential\CredentialInterface;
15
use LightSaml\Criteria\CriteriaSet;
16
17
class CompositeUnionResolver extends AbstractCompositeResolver
18
{
19
    /**
20
     * @param CriteriaSet           $criteriaSet
21
     * @param CredentialInterface[] $arrCredentials
22
     *
23
     * @return CredentialInterface[]
24
     */
25 View Code Duplication
    public function resolve(CriteriaSet $criteriaSet, array $arrCredentials = array())
0 ignored issues
show
Duplication introduced by
This method 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...
26
    {
27
        $result = array();
28
        foreach ($this->resolvers as $resolver) {
29
            $result = array_merge($result, $resolver->resolve($criteriaSet, $arrCredentials));
30
        }
31
32
        return $result;
33
    }
34
}
35