Issues (37)

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/Traits/Geocoding.php (5 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
namespace Webdcg\Redis\Traits;
4
5
trait Geocoding
6
{
7
    /**
8
     * Add one or more geospatial items to the specified key. This function must
9
     * be called with at least one longitude, latitude, member triplet.
10
     *
11
     * @param  string $key
12
     * @param  float  $longitude
13
     * @param  float  $latitude
14
     * @param  string $member
15
     * @param  $locations
16
     *
17
     * @return int                  The number of elements added to the geospatial key.
18
     */
19
    public function geoAdd(string $key, float $longitude, float $latitude, string $member, ...$locations): int
20
    {
21
        return $this->redis->geoAdd($key, $longitude, $latitude, $member, ...$locations);
0 ignored issues
show
The property redis does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
22
    }
23
24
    /**
25
     * Retrieve Geohash strings for one or more elements of a geospatial index.
26
     *
27
     * @param  string $key
28
     * @param  string $member
29
     * @param  splat  $members
30
     *
31
     * @return array            One or more Redis Geohash encoded strings.
32
     */
33
    public function geoHash(string $key, string $member, ...$members): array
0 ignored issues
show
The parameter $members 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...
34
    {
35
        return $this->redis->geoHash($key, $member);
36
    }
37
38
    /**
39
     * Return longitude, latitude positions for each requested member.
40
     *
41
     * @param  string $key
42
     * @param  string $member
43
     * @param  splat $members
44
     *
45
     * @return array            One or more longitude/latitude positions
46
     */
47
    public function geoPos(string $key, string $member, ...$members): array
0 ignored issues
show
The parameter $members 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...
48
    {
49
        return $this->redis->geoPos($key, $member);
50
    }
51
52
    /**
53
     * Return the distance between two members in a geospatial set. If units
54
     * are passed it must be one of the following values:.
55
     *
56
     * @param  string $key
57
     * @param  string $member1
58
     * @param  string $member2
59
     * @param  string $unit
60
     *
61
     * @return float
62
     */
63
    public function geoDist(string $key, string $member1, string $member2, string $unit = 'm'): float
64
    {
65
        return $this->redis->geoDist($key, $member1, $member2, $unit);
66
    }
67
68
    /**
69
     * Return members of a set with geospatial information that are within the
70
     * radius specified by the caller.
71
     *
72
     * @param  string $key
73
     * @param  float  $longitude
74
     * @param  float  $latitude
75
     * @param  float  $radius
76
     * @param  string $unit
77
     * @param  array  $options
78
     *
79
     * @return array            When no STORE option is passed, this function
80
     *                          returns an array of results.
81
     */
82
    public function geoRadius(
83
        string $key,
84
        float $longitude,
85
        float $latitude,
86
        float $radius,
87
        string $unit = 'm',
88
        ?array $options = []
0 ignored issues
show
The parameter $options 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...
89
    ): array {
90
        return $this->redis->geoRadius($key, $longitude, $latitude, $radius, $unit);
91
    }
92
93
    /**
94
     * This method is identical to geoRadius except that instead of passing a
95
     * longitude and latitude as the "source" you pass an existing member in
96
     * the geospatial set.
97
     *
98
     * @param  string $key
99
     * @param  string $member
100
     * @param  float  $radius
101
     * @param  string $unit
102
     * @param  array  $options
103
     *
104
     * @return array
105
     */
106
    public function geoRadiusByMember(
107
        string $key,
108
        string $member,
109
        float $radius,
110
        string $unit,
111
        ?array $options = []
0 ignored issues
show
The parameter $options 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...
112
    ): array {
113
        return $this->redis->geoRadiusByMember($key, $member, $radius, $unit);
114
    }
115
}
116