1 | <?php |
||
8 | class Packagist |
||
9 | { |
||
10 | /** @var \GuzzleHttp\Client */ |
||
11 | protected $client; |
||
12 | |||
13 | /** @var string */ |
||
14 | protected $baseUrl; |
||
15 | |||
16 | /** |
||
17 | * @param \GuzzleHttp\Client $client |
||
18 | * @param string $baseUrl |
||
19 | */ |
||
20 | public function __construct(Client $client, $baseUrl = 'https://packagist.org') |
||
26 | |||
27 | /** |
||
28 | * @param string $type |
||
29 | * |
||
30 | * @return array |
||
31 | */ |
||
32 | public function getPackagesByType($type) |
||
40 | |||
41 | /** |
||
42 | * @param string $vendor |
||
43 | * |
||
44 | * @return array |
||
45 | */ |
||
46 | public function getPackagesByVendor($vendor) |
||
54 | |||
55 | /** |
||
56 | * @param string $name |
||
57 | * |
||
58 | * @return array |
||
59 | */ |
||
60 | public function getPackagesByName($name, $type = '') |
||
70 | |||
71 | /** |
||
72 | * @param $vendor |
||
73 | * @param string $packageName |
||
74 | * |
||
75 | * @return array |
||
76 | */ |
||
77 | public function findPackageByName($vendor, $packageName = '') |
||
88 | |||
89 | /** |
||
90 | * @param string $resource |
||
91 | * @param array $query |
||
92 | * |
||
93 | * @return array |
||
94 | */ |
||
95 | public function makeRequest($resource, array $query = []) |
||
104 | |||
105 | /** |
||
106 | * @param string $name |
||
107 | * |
||
108 | * @return array |
||
109 | */ |
||
110 | public function getPackageMetadata($name) |
||
120 | } |
||
121 |
This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.