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

Security Analysis    not enabled

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/Options/RevisionOptions.php (3 issues)

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 Neurony\Revisions\Options;
4
5
use Exception;
6
use Illuminate\Support\Arr;
7
8
class RevisionOptions
9
{
10
    /**
11
     * Flag whether to make a revision on model creation.
12
     *
13
     * @var bool
14
     */
15
    private $revisionOnCreate = false;
16
17
    /**
18
     * The limit of revisions to be created for a model instance.
19
     * If the limit is reached, oldest revisions will start getting deleted to make room for new ones.
20
     *
21
     * @var int
22
     */
23
    private $revisionLimit;
24
25
    /**
26
     * The fields that should be revisionable.
27
     * By default (null) all fields are revisionable.
28
     *
29
     * @var array
30
     */
31
    private $revisionFields = [];
32
33
    /**
34
     * The fields that should be excluded from revisioning.
35
     * By default (null) no fields are excluded from revisioning.
36
     *
37
     * @var array
38
     */
39
    private $revisionNotFields = [];
40
41
    /**
42
     * The model's relations that should be revisionable.
43
     * By default (null) none of the model's relations are revisionable.
44
     *
45
     * @var array
46
     */
47
    private $revisionRelations = [];
48
49
    /**
50
     * Flag indicating whether to create a revision for the model, when rolling back another revision of that model.
51
     * If set to "true", before rolling back a revision, the original model instance's data will be stored to a new revision.
52
     * If set to "false", after rolling back a revision, the original model instance's data will NOT be stored to a new revision.
53
     *
54
     * @var bool
55
     */
56
    private $createRevisionWhenRollingBack = true;
57
58
    /**
59
     * Flag indicating whether to include timestamps in the revision.
60
     *
61
     * @var bool
62
     */
63
    private $revisionTimestamps = false;
64
65
    /**
66
     * Get the value of a property of this class.
67
     *
68
     * @param $name
69
     * @return mixed
70
     * @throws Exception
71
     */
72
    public function __get($name)
73
    {
74
        if (property_exists(static::class, $name)) {
75
            return $this->{$name};
76
        }
77
78
        throw new Exception(
79
            'The property "'.$name.'" does not exist in class "'.static::class.'"'
80
        );
81
    }
82
83
    /**
84
     * Get a fresh instance of this class.
85
     *
86
     * @return RevisionOptions
87
     */
88
    public static function instance(): self
89
    {
90
        return new static();
91
    }
92
93
    /**
94
     * Set the $revisionOnCreate to work with in the Neurony\Revisions\Traits\HasRevisions trait.
95
     *
96
     * @return RevisionOptions
97
     */
98
    public function enableRevisionOnCreate(): self
99
    {
100
        $this->revisionOnCreate = true;
101
102
        return $this;
103
    }
104
105
    /**
106
     * Set the $revisionLimit to work with in the Neurony\Revisions\Traits\HasRevisions trait.
107
     *
108
     * @param int $limit
109
     * @return RevisionOptions
110
     */
111
    public function limitRevisionsTo(int $limit): self
112
    {
113
        $this->revisionLimit = (int) $limit;
114
115
        return $this;
116
    }
117
118
    /**
119
     * Set the $revisionFields to work with in the Neurony\Revisions\Traits\HasRevisions trait.
120
     *
121
     * @param $fields
122
     * @return RevisionOptions
123
     */
124
    public function fieldsToRevision(...$fields): self
125
    {
126
        $this->revisionFields = Arr::flatten($fields);
0 ignored issues
show
$fields is of type array<integer,?>, but the function expects a object<Illuminate\Support\iterable>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
127
128
        return $this;
129
    }
130
131
    /**
132
     * Set the $revisionNotFields to work with in the Neurony\Revisions\Traits\HasRevisions trait.
133
     *
134
     * @param $fields
135
     * @return RevisionOptions
136
     */
137
    public function fieldsToNotRevision(...$fields): self
138
    {
139
        $this->revisionNotFields = Arr::flatten($fields);
0 ignored issues
show
$fields is of type array<integer,?>, but the function expects a object<Illuminate\Support\iterable>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
140
141
        return $this;
142
    }
143
144
    /**
145
     * Set the $revisionRelations to work with in the Neurony\Revisions\Traits\HasRevisions trait.
146
     *
147
     * @param $relations
148
     * @return RevisionOptions
149
     */
150
    public function relationsToRevision(...$relations): self
151
    {
152
        $this->revisionRelations = Arr::flatten($relations);
0 ignored issues
show
$relations is of type array<integer,?>, but the function expects a object<Illuminate\Support\iterable>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
153
154
        return $this;
155
    }
156
157
    /**
158
     * Set the $createRevisionWhenRollingBack to work with in the Neurony\Revisions\Traits\HasRevisions trait.
159
     *
160
     * @return RevisionOptions
161
     */
162
    public function disableRevisioningWhenRollingBack(): self
163
    {
164
        $this->createRevisionWhenRollingBack = false;
165
166
        return $this;
167
    }
168
169
    /**
170
     * Enable the revisioning of timestamps.
171
     *
172
     * @return $this
173
     */
174
    public function withTimestamps()
175
    {
176
        $this->revisionTimestamps = true;
177
178
        return $this;
179
    }
180
}
181