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

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/DuplicateOptions.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\Duplicate\Options;
4
5
use Exception;
6
use Illuminate\Support\Arr;
7
8
class DuplicateOptions
9
{
10
    /**
11
     * The database columns that should be ignored when duplicating the record.
12
     *
13
     * @var array|string
14
     */
15
    private $excludedColumns;
16
17
    /**
18
     * The database columns that should be unique when duplicating the record.
19
     *
20
     * @var array|string
21
     */
22
    private $uniqueColumns;
23
24
    /**
25
     * The relations of the model that should be ignored when duplicating the record.
26
     *
27
     * @var array|string
28
     */
29
    private $excludedRelations;
30
31
    /**
32
     * The database columns for each model's relation that should be ignored when duplicating the record.
33
     *
34
     * @var array
35
     */
36
    private $excludedRelationColumns;
37
38
    /**
39
     * The database columns for each model's relation that should be unique when duplicating the record.
40
     *
41
     * @var array
42
     */
43
    private $uniqueRelationColumns;
44
45
    /**
46
     * Flag indicating if when duplicating a record, the script should also duplicate it's relations.
47
     *
48
     * @var bool
49
     */
50
    private $shouldDuplicateDeeply = true;
51
52
    /**
53
     * Get the value of a property of this class.
54
     *
55
     * @param $name
56
     * @return mixed
57
     * @throws Exception
58
     */
59
    public function __get($name)
60
    {
61
        if (property_exists(static::class, $name)) {
62
            return $this->{$name};
63
        }
64
65
        throw new Exception(
66
            'The property "'.$name.'" does not exist in class "'.static::class.'"'
67
        );
68
    }
69
70
    /**
71
     * Get a fresh instance of this class.
72
     *
73
     * @return DuplicateOptions
74
     */
75
    public static function instance(): self
76
    {
77
        return new static();
78
    }
79
80
    /**
81
     * Set the $excludedColumns to work with in the Neurony\Duplicate\Traits\HasDuplicates trait.
82
     *
83
     * @param array|string $columns
84
     * @return DuplicateOptions
85
     */
86
    public function excludeColumns(...$columns): self
87
    {
88
        $this->excludedColumns = Arr::flatten($columns);
0 ignored issues
show
$columns is of type array<integer,array|string>, 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...
89
90
        return $this;
91
    }
92
93
    /**
94
     * Set the $uniqueColumns to work with in the Neurony\Duplicate\Traits\HasDuplicates trait.
95
     *
96
     * @param array|string $columns
97
     * @return DuplicateOptions
98
     */
99
    public function uniqueColumns(...$columns): self
100
    {
101
        $this->uniqueColumns = Arr::flatten($columns);
0 ignored issues
show
$columns is of type array<integer,array|string>, 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...
102
103
        return $this;
104
    }
105
106
    /**
107
     * Set the $excludedRelations to work with in the Neurony\Duplicate\Traits\HasDuplicates trait.
108
     *
109
     * @param array|string $relations
110
     * @return DuplicateOptions
111
     */
112
    public function excludeRelations(...$relations): self
113
    {
114
        $this->excludedRelations = Arr::flatten($relations);
0 ignored issues
show
$relations is of type array<integer,array|string>, 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...
115
116
        return $this;
117
    }
118
119
    /**
120
     * Set the $excludedRelationColumns to work with in the Neurony\Duplicate\Traits\HasDuplicates trait.
121
     *
122
     * Param $columns:
123
     * --- associative array with keys containing each relation name and values (array) containing the excluded columns for each relation.
124
     *
125
     * @param array $columns
126
     * @return DuplicateOptions
127
     */
128
    public function excludeRelationColumns(array $columns = []): self
129
    {
130
        $this->excludedRelationColumns = $columns;
131
132
        return $this;
133
    }
134
135
    /**
136
     * Set the $uniqueRelationColumns to work with in the Neurony\Duplicate\Traits\HasDuplicates trait.
137
     *
138
     * Param $columns:
139
     * --- associative array with keys containing each relation name and values (array) containing the unique columns for each relation.
140
     *
141
     * @param array $columns
142
     * @return DuplicateOptions
143
     */
144
    public function uniqueRelationColumns(array $columns = []): self
145
    {
146
        $this->uniqueRelationColumns = $columns;
147
148
        return $this;
149
    }
150
151
    /**
152
     * Set the $shouldDuplicateDeeply to work with in the Neurony\Duplicate\Traits\HasDuplicates trait.
153
     *
154
     * @return DuplicateOptions
155
     */
156
    public function disableDeepDuplication(): self
157
    {
158
        $this->shouldDuplicateDeeply = false;
159
160
        return $this;
161
    }
162
}
163