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 (22)

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/Activatable.php (4 issues)

Labels
Severity

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 Spatie\Menu\Traits;
4
5
use Spatie\Menu\ActiveUrlChecker;
6
use Spatie\Menu\ExactUrlChecker;
7
use Spatie\Url\Url;
8
9
/**
10
 * Expects an `$active` property on the class.
11
 *
12
 * @property string $url
13
 */
14
trait Activatable
15
{
16
    /**
17
     * @var bool
18
     */
19
    protected $exactActive = false;
20
21
    /**
22
     * @return bool
23
     */
24
    public function isActive(): bool
25
    {
26
        return $this->active;
0 ignored issues
show
The property active does not seem to exist. Did you mean exactActive?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
27
    }
28
29
    /**
30
     * @param bool|callable $active
31
     *
32
     * @return $this
33
     */
34
    public function setActive($active = true)
35
    {
36
        if (is_callable($active)) {
37
            $this->active = $active($this);
0 ignored issues
show
The property active does not seem to exist. Did you mean exactActive?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
38
39
            return $this;
40
        }
41
42
        $this->active = (bool) $active;
0 ignored issues
show
The property active does not seem to exist. Did you mean exactActive?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
43
44
        return $this;
45
    }
46
47
    /**
48
     * @return $this
49
     */
50
    public function setInactive()
51
    {
52
        $this->active = false;
0 ignored issues
show
The property active does not seem to exist. Did you mean exactActive?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
53
54
        return $this;
55
    }
56
57
    /**
58
     * @return string|null
59
     */
60
    public function url()
61
    {
62
        return $this->url;
63
    }
64
65
    /**
66
     * @return bool
67
     */
68
    public function hasUrl(): bool
69
    {
70
        return ! is_null($this->url);
71
    }
72
73
    /**
74
     * @param string|null $url
75
     *
76
     * @return $this
77
     */
78
    public function setUrl($url)
79
    {
80
        $this->url = $url;
81
82
        return $this;
83
    }
84
85
    /**
86
     * @param string $url
87
     * @param string $root
88
     *
89
     * @return $this
90
     */
91
    public function determineActiveForUrl(string $url, string $root = '/')
92
    {
93
        if (! $this->hasUrl()) {
94
            return;
95
        }
96
97
        ActiveUrlChecker::check($this->url, $url, $root)
98
            ? $this->setActive()
99
            : $this->setInactive();
100
101
        ExactUrlChecker::check($this->url, $url, $root)
102
            ? $this->setExactActive()
103
            : $this->setExactActive(false);
104
    }
105
106
    /**
107
     * Set if current Activatable should be marked as an exact url match.
108
     *
109
     * @param bool $exactActive
110
     *
111
     * @return $this
112
     */
113
    public function setExactActive(bool $exactActive = true)
114
    {
115
        $this->exactActive = $exactActive;
116
117
        return $this;
118
    }
119
120
    /**
121
     * Check if current Activatable is marked as an exact url match.
122
     *
123
     * @return bool
124
     */
125
    public function isExactActive(): bool
126
    {
127
        return $this->exactActive;
128
    }
129
}
130