GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Search::getPeople()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
namespace Coinpaprika\Model;
4
5
use Coinpaprika\Model\Coin;
6
use Coinpaprika\Model\Exchange;
7
use Coinpaprika\Model\Search\Ico;
0 ignored issues
show
Bug introduced by
This use statement conflicts with another class in this namespace, Coinpaprika\Model\Ico. Consider defining an alias.

Let?s assume that you have a directory layout like this:

.
|-- OtherDir
|   |-- Bar.php
|   `-- Foo.php
`-- SomeDir
    `-- Foo.php

and let?s assume the following content of Bar.php:

// Bar.php
namespace OtherDir;

use SomeDir\Foo; // This now conflicts the class OtherDir\Foo

If both files OtherDir/Foo.php and SomeDir/Foo.php are loaded in the same runtime, you will see a PHP error such as the following:

PHP Fatal error:  Cannot use SomeDir\Foo as Foo because the name is already in use in OtherDir/Foo.php

However, as OtherDir/Foo.php does not necessarily have to be loaded and the error is only triggered if it is loaded before OtherDir/Bar.php, this problem might go unnoticed for a while. In order to prevent this error from surfacing, you must import the namespace with a different alias:

// Bar.php
namespace OtherDir;

use SomeDir\Foo as SomeDirFoo; // There is no conflict anymore.
Loading history...
8
use Coinpaprika\Model\Person;
9
use Coinpaprika\Model\Tag;
10
11
/**
12
 * Class Search
13
 *
14
 * @package \Coinpaprika\Model
15
 *
16
 * @author Krzysztof Przybyszewski <[email protected]>
17
 */
18
class Search
19
{
20
    /**
21
     * @var Coin[]
22
     */
23
    private $currencies = [];
24
25
    /**
26
     * @var Exchange[]
27
     */
28
    private $exchanges = [];
29
30
    /**
31
     * @var Ico[]
32
     */
33
    private $icos = [];
34
35
    /**
36
     * @var Person[]
37
     */
38
    private $people = [];
39
40
    /**
41
     * @var Tag[]
42
     */
43
    private $tags = [];
44
45
    /**
46
     * @return Coin[]
47
     */
48 2
    public function getCurrencies(): array
49
    {
50 2
        return $this->currencies;
51
    }
52
53
    /**
54
     * @param Coin[] $currencies
55
     */
56 1
    public function setCurrencies(array $currencies): void
57
    {
58 1
        $this->currencies = $currencies;
59 1
    }
60
61
    /**
62
     * @return Exchange[]
63
     */
64 1
    public function getExchanges(): array
65
    {
66 1
        return $this->exchanges;
67
    }
68
69
    /**
70
     * @param Exchange[] $exchanges
71
     */
72 1
    public function setExchanges(array $exchanges): void
73
    {
74 1
        $this->exchanges = $exchanges;
75 1
    }
76
77
    /**
78
     * @return Ico[]
79
     */
80 2
    public function getIcos(): array
81
    {
82 2
        return $this->icos;
83
    }
84
85
    /**
86
     * @param Ico[] $icos
87
     */
88 1
    public function setIcos(array $icos): void
89
    {
90 1
        $this->icos = $icos;
91 1
    }
92
93
    /**
94
     * @return Person[]
95
     */
96 3
    public function getPeople(): array
97
    {
98 3
        return $this->people;
99
    }
100
101
    /**
102
     * @param Person[] $people
103
     */
104 3
    public function setPeople(array $people): void
105
    {
106 3
        $this->people = $people;
107 3
    }
108
109
    /**
110
     * @return Tag[]
111
     */
112 2
    public function getTags(): array
113
    {
114 2
        return $this->tags;
115
    }
116
117
    /**
118
     * @param Tag[] $tags
119
     */
120 2
    public function setTags(array $tags): void
121
    {
122 2
        $this->tags = $tags;
123 2
    }
124
}
125