Provider::findRegionByName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 1 Features 0
Metric Value
c 2
b 1
f 0
dl 0
loc 3
rs 10
cc 1
eloc 2
nc 1
nop 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