Completed
Push — 16.x ( 0056bb...bd3602 )
by Tim
02:11 queued 10s
created

DefaultOkFileSorter   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 12 3
1
<?php
2
3
/**
4
 * TechDivision\Import\Loaders\Sorters\DefaultOkFileSorter
5
 *
6
 * NOTICE OF LICENSE
7
 *
8
 * This source file is subject to the Open Software License (OSL 3.0)
9
 * that is available through the world-wide-web at this URL:
10
 * http://opensource.org/licenses/osl-3.0.php
11
 *
12
 * PHP version 5
13
 *
14
 * @author    Tim Wagner <[email protected]>
15
 * @copyright 2020 TechDivision GmbH <[email protected]>
16
 * @license   http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
 * @link      https://github.com/techdivision/import
18
 * @link      http://www.techdivision.com
19
 */
20
21
namespace TechDivision\Import\Loaders\Sorters;
22
23
/**
24
 * Factory for file writer instances.
25
 *
26
 * @author    Tim Wagner <[email protected]>
27
 * @copyright 2020 TechDivision GmbH <[email protected]>
28
 * @license   http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
 * @link      https://github.com/techdivision/import
30
 * @link      http://www.techdivision.com
31
 */
32
class DefaultOkFileSorter
33
{
34
35
    /**
36
     *
37
     * @param array  $v
0 ignored issues
show
Bug introduced by
There is no parameter named $v. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
38
     * @param string $k
0 ignored issues
show
Bug introduced by
There is no parameter named $k. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
39
     *
40
     * @return boolean TRUE if the value with the actual key should be in the array, else FALSE
41
     */
42
    public function __invoke(array $a, array $b) : int
43
    {
44
45
        $countA = sizeof($a);
46
        $countB = sizeof($b);
47
48
        if ($countA === $countB) {
49
            return 0;
50
        }
51
52
        return ($countB < $countA) ? - 1 : 1;
53
    }
54
}