MultiComparatorTests   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 2
dl 0
loc 23
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A defaultConstructorArguments() 0 6 1
A compareDataProvider() 0 7 3
1
<?php
2
3
/**
4
 * This file is part of the Cubiche package.
5
 *
6
 * Copyright (c) Cubiche
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
namespace Cubiche\Core\Comparable\Tests\Units;
12
13
use Cubiche\Core\Comparable\Comparator;
14
15
/**
16
 * Multi Comparator Tests class.
17
 *
18
 * @author Ivannis Suárez Jerez <[email protected]>
19
 * @author Karel Osorio Ramírez <[email protected]>
20
 */
21
class MultiComparatorTests extends ComparatorTestCase
22
{
23
    /**
24
     * {@inheritdoc}
25
     */
26
    protected function defaultConstructorArguments()
27
    {
28
        return array(new Comparator(), function ($a, $b) {
0 ignored issues
show
Unused Code introduced by
The parameter $a 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...
Unused Code introduced by
The parameter $b 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...
29
            return 1;
30
        });
31
    }
32
33
    /**
34
     * {@inheritdoc}
35
     */
36
    protected function compareDataProvider()
37
    {
38
        foreach (parent::compareDataProvider() as $key => $data) {
39
            $data[2] = $data[2] == 0 ? 1 : $data[2];
40
            yield $key => $data;
41
        }
42
    }
43
}
44