Provider   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 6
Bugs 1 Features 2
Metric Value
wmc 7
c 6
b 1
f 2
lcom 1
cbo 1
dl 0
loc 34
rs 10

7 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A findAllDepartements() 0 3 1
A findAllRegions() 0 3 1
A findDepartementByCode() 0 3 1
A findDepartementByName() 0 3 1
A findRegionByName() 0 3 1
A findRegionByCode() 0 3 1
1
<?php
2
3
namespace Departements;
4
5
use Departements\Datasource\DatasourceInterface;
6
7
use PhpCollection\Map;
8
9
class Provider
10
{
11
    private $datasource;
12
13
    public function __construct(DatasourceInterface $datasource)
14
    {
15
        $this->datasource = $datasource;
16
    }
17
18
    public function findAllDepartements($sortByValue = null) {
19
        return $this->datasource->findAllDepartements($sortByValue);
0 ignored issues
show
Unused Code introduced by
The call to DatasourceInterface::findAllDepartements() has too many arguments starting with $sortByValue.

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
20
    }
21
22
    public function findAllRegions($sortByValue = null) {
23
        return $this->datasource->findAllRegions($sortByValue);
0 ignored issues
show
Unused Code introduced by
The call to DatasourceInterface::findAllRegions() has too many arguments starting with $sortByValue.

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
24
    }
25
26
    public function findDepartementByCode($departementCode) {
27
        return $this->datasource->findDepartementByCode($departementCode);
28
    }
29
30
    public function findDepartementByName($departementName) {
31
        return $this->datasource->findDepartementByName($departementName);
32
    }
33
34
    public function findRegionByName($regionName) {
35
        return $this->datasource->findRegionByName($regionName);
36
    }
37
38
    public function findRegionByCode($regionCode) {
39
        return $this->datasource->findRegionByCode($regionCode);
40
    }
41
42
}
43
44