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.

Issues (153)

Security Analysis    no request data  

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  Cross-Site Scripting
Cross-Site Scripting enables an attacker to inject code into the response of a web-request that is viewed by other users. It can for example be used to bypass access controls, or even to take over other users' accounts.
  File Exposure
File Exposure allows an attacker to gain access to local files that he should not be able to access. These files can for example include database credentials, or other configuration files.
  File Manipulation
File Manipulation enables an attacker to write custom data to files. This potentially leads to injection of arbitrary code on the server.
  Object Injection
Object Injection enables an attacker to inject an object into PHP code, and can lead to arbitrary code execution, file exposure, or file manipulation attacks.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  File Inclusion
File Inclusion enables an attacker to inject custom files into PHP's file loading mechanism, either explicitly passed to include, or for example via PHP's auto-loading mechanism.
  Command Injection
Command Injection enables an attacker to inject a shell command that is execute with the privileges of the web-server. This can be used to expose sensitive data, or gain access of your server.
  SQL Injection
SQL Injection enables an attacker to execute arbitrary SQL code on your database server gaining access to user data, or manipulating user data.
  XPath Injection
XPath Injection enables an attacker to modify the parts of XML document that are read. If that XML document is for example used for authentication, this can lead to further vulnerabilities similar to SQL Injection.
  LDAP Injection
LDAP Injection enables an attacker to inject LDAP statements potentially granting permission to run unauthorized queries, or modify content inside the LDAP tree.
  Header Injection
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  XML Injection
XML Injection enables an attacker to read files on your local filesystem including configuration files, or can be abused to freeze your web-server process.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
Unfortunately, the security analysis is currently not available for your project. If you are a non-commercial open-source project, please contact support to gain access.

src/Common/ProviderAggregator.php (3 issues)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the Geocoder package.
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 *
10
 * @license    MIT License
11
 */
12
13
namespace Geocoder;
14
15
use Geocoder\Exception\ProviderNotRegistered;
16
use Geocoder\Model\Coordinates;
17
use Geocoder\Query\GeocodeQuery;
18
use Geocoder\Query\ReverseQuery;
19
use Geocoder\Provider\Provider;
20
21
/**
22
 * @author William Durand <[email protected]>
23
 */
24
class ProviderAggregator implements Geocoder
25
{
26
    /**
27
     * @var Provider[]
28
     */
29
    private $providers = [];
30
31
    /**
32
     * @var Provider
33
     */
34
    private $provider;
35
36
    /**
37
     * @var int
38
     */
39
    private $limit;
40
41
    /**
42
     * A callable that decided what provider to use.
43
     *
44
     * @var callable
45
     */
46
    private $decider;
47
48
    /**
49
     * @param callable|null $decider
50
     * @param int           $limit
51
     */
52
    public function __construct(callable $decider = null, int $limit = Geocoder::DEFAULT_RESULT_LIMIT)
53
    {
54
        $this->limit = $limit;
55
        $this->decider = $decider ?? __CLASS__.'::getProvider';
56
    }
57
58
    /**
59
     * {@inheritdoc}
60
     */
61
    public function geocodeQuery(GeocodeQuery $query): Collection
62
    {
63
        if (null === $query->getLimit()) {
64
            $query = $query->withLimit($this->limit);
65
        }
66
67
        return call_user_func($this->decider, $query, $this->providers, $this->provider)->geocodeQuery($query);
68
    }
69
70
    /**
71
     * {@inheritdoc}
72
     */
73
    public function reverseQuery(ReverseQuery $query): Collection
74
    {
75
        if (null === $query->getLimit()) {
76
            $query = $query->withLimit($this->limit);
77
        }
78
79
        return call_user_func($this->decider, $query, $this->providers, $this->provider)->reverseQuery($query);
80
    }
81
82
    /**
83
     * {@inheritdoc}
84
     */
85
    public function getName(): string
86
    {
87
        return 'provider_aggregator';
88
    }
89
90
    /**
91
     * {@inheritdoc}
92
     */
93
    public function geocode(string $value): Collection
94
    {
95
        return $this->geocodeQuery(GeocodeQuery::create($value)
96
            ->withLimit($this->limit));
97
    }
98
99
    /**
100
     * {@inheritdoc}
101
     */
102
    public function reverse(float $latitude, float $longitude): Collection
103
    {
104
        return $this->reverseQuery(ReverseQuery::create(new Coordinates($latitude, $longitude))
105
            ->withLimit($this->limit));
106
    }
107
108
    /**
109
     * Registers a new provider to the aggregator.
110
     *
111
     * @param Provider $provider
112
     *
113
     * @return ProviderAggregator
114
     */
115
    public function registerProvider(Provider $provider): self
116
    {
117
        $this->providers[$provider->getName()] = $provider;
118
119
        return $this;
120
    }
121
122
    /**
123
     * Registers a set of providers.
124
     *
125
     * @param Provider[] $providers
126
     *
127
     * @return ProviderAggregator
128
     */
129
    public function registerProviders(array $providers = []): self
130
    {
131
        foreach ($providers as $provider) {
132
            $this->registerProvider($provider);
133
        }
134
135
        return $this;
136
    }
137
138
    /**
139
     * Sets the default provider to use.
140
     *
141
     * @param string $name
142
     *
143
     * @return ProviderAggregator
144
     */
145
    public function using(string $name): self
146
    {
147
        if (!isset($this->providers[$name])) {
148
            throw ProviderNotRegistered::create($name ?? '', $this->providers);
149
        }
150
151
        $this->provider = $this->providers[$name];
152
153
        return $this;
154
    }
155
156
    /**
157
     * Returns all registered providers indexed by their name.
158
     *
159
     * @return Provider[]
160
     */
161
    public function getProviders(): array
162
    {
163
        return $this->providers;
164
    }
165
166
    /**
167
     * Get a provider to use for this query.
168
     *
169
     * @param GeocodeQuery|ReverseQuery $query
170
     * @param Provider[]                $providers
171
     * @param Provider                  $currentProvider
0 ignored issues
show
Should the type for parameter $currentProvider not be null|Provider?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
172
     *
173
     * @return Provider
174
     *
175
     * @throws ProviderNotRegistered
176
     */
177
    private static function getProvider($query, array $providers, Provider $currentProvider = null): Provider
0 ignored issues
show
This method is not used, and could be removed.
Loading history...
The parameter $query is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
178
    {
179
        if (null !== $currentProvider) {
180
            return $currentProvider;
181
        }
182
183
        if (0 === count($providers)) {
184
            throw ProviderNotRegistered::noProviderRegistered();
185
        }
186
187
        // Take first
188
        $key = key($providers);
189
190
        return $providers[$key];
191
    }
192
}
193