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.
Completed
Push — master ( 5d27ce...6ee2cf )
by Krzysztof
02:23
created

Search::setPeople()   A

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 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Coinpaprika\Model;
4
5
use Coinpaprika\Model\{Coin, Exchange, Ico, Person, Tag};
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...
Bug introduced by
This use statement conflicts with another class in this namespace, Coinpaprika\Model\Tag. 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...
Bug introduced by
This use statement conflicts with another class in this namespace, Coinpaprika\Model\Coin. 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...
Bug introduced by
This use statement conflicts with another class in this namespace, Coinpaprika\Model\Exchange. 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...
Bug introduced by
This use statement conflicts with another class in this namespace, Coinpaprika\Model\Person. 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...
6
7
/**
8
 * Class Search
9
 *
10
 * @package \Coinpaprika\Model
11
 *
12
 * @author Krzysztof Przybyszewski <[email protected]>
13
 */
14
class Search
15
{
16
    /**
17
     * @var Coin[]
18
     */
19
    private $currencies = [];
20
21
    /**
22
     * @var Exchange[]
23
     */
24
    private $exchanges = [];
25
26
    /**
27
     * @var Ico[]
28
     */
29
    private $icos = [];
30
31
    /**
32
     * @var Person[]
33
     */
34
    private $people = [];
35
36
    /**
37
     * @var Tag[]
38
     */
39
    private $tags = [];
40
41
    /**
42
     * @return Coin[]
43
     */
44 2
    public function getCurrencies(): array
45
    {
46 2
        return $this->currencies;
47
    }
48
49
    /**
50
     * @param Coin[] $currencies
51
     */
52 1
    public function setCurrencies(array $currencies): void
53
    {
54 1
        $this->currencies = $currencies;
55 1
    }
56
57
    /**
58
     * @return Exchange[]
59
     */
60 1
    public function getExchanges(): array
61
    {
62 1
        return $this->exchanges;
63
    }
64
65
    /**
66
     * @param Exchange[] $exchanges
67
     */
68 1
    public function setExchanges(array $exchanges): void
69
    {
70 1
        $this->exchanges = $exchanges;
71 1
    }
72
73
    /**
74
     * @return Ico[]
75
     */
76 2
    public function getIcos(): array
77
    {
78 2
        return $this->icos;
79
    }
80
81
    /**
82
     * @param Ico[] $icos
83
     */
84 1
    public function setIcos(array $icos): void
85
    {
86 1
        $this->icos = $icos;
87 1
    }
88
89
    /**
90
     * @return Person[]
91
     */
92 3
    public function getPeople(): array
93
    {
94 3
        return $this->people;
95
    }
96
97
    /**
98
     * @param Person[] $people
99
     */
100 3
    public function setPeople(array $people): void
101
    {
102 3
        $this->people = $people;
103 3
    }
104
105
    /**
106
     * @return Tag[]
107
     */
108 2
    public function getTags(): array
109
    {
110 2
        return $this->tags;
111
    }
112
113
    /**
114
     * @param Tag[] $tags
115
     */
116 2
    public function setTags(array $tags): void
117
    {
118 2
        $this->tags = $tags;
119 2
    }
120
}
121