Issues (11)

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/AbstractResource.php (2 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 Cerbero\FluentApi;
4
5
use Cerbero\FluentApi\Requests\Request;
6
7
/**
8
 * Abstract implementation of an API resource.
9
 *
10
 */
11
abstract class AbstractResource extends VersionableRequestMaker
12
{
13
    /**
14
     * The resource HTTP verb.
15
     *
16
     * @var string|null
17
     */
18
    protected $verb;
19
20
    /**
21
     * The HTTP call options.
22
     *
23
     * @var array
24
     */
25
    protected $options = [];
26
27
    /**
28
     * Retrieve the resource endpoint.
29
     *
30
     * @return    string
31
     */
32
    abstract public function getEndpoint();
33
34
    /**
35
     * Retrieve the request to pass through resources.
36
     *
37
     * @return    Cerbero\FluentApi\Requests\Request
38
     */
39
    public function getRequest()
40
    {
41
        return $this->request;
42
    }
43
44
    /**
45
     * Update the given request with the resource options.
46
     *
47
     * @param    Cerbero\FluentApi\Requests\Request    $request
48
     * @return    Cerbero\FluentApi\Requests\Request
49
     */
50
    public function updateOptions(Request $request)
51
    {
52
        return $this->request = $request->setOptions($this->getOptions());
0 ignored issues
show
Documentation Bug introduced by
It seems like $request->setOptions($this->getOptions()) of type object<Cerbero\FluentApi\Requests\Request> is incompatible with the declared type object<Cerbero\FluentApi...ntApi\Requests\Request> of property $request.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
53
    }
54
55
    /**
56
     * Fill the given request with the resource details.
57
     *
58
     * @param    Cerbero\FluentApi\Requests\Request    $request
59
     * @return    Cerbero\FluentApi\Requests\Request
60
     */
61
    public function fillRequest(Request $request)
62
    {
63
        return $this->request = $this->updateOptions($request)
0 ignored issues
show
Documentation Bug introduced by
It seems like $this->updateOptions($re...t($this->getEndpoint()) of type object<Cerbero\FluentApi\Requests\Request> is incompatible with the declared type object<Cerbero\FluentApi...ntApi\Requests\Request> of property $request.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
64
                                     ->setVerb($this->getVerb())
65
                                     ->setEndpoint($this->getEndpoint());
66
    }
67
68
    /**
69
     * Retrieve the resource HTTP verb.
70
     *
71
     * @return    string
72
     */
73
    public function getVerb()
74
    {
75
        return $this->verb;
76
    }
77
78
    /**
79
     * Set the HTTP call options.
80
     *
81
     * @param    array    $options
82
     * @return    $this
83
     */
84
    public function setOptions(array $options)
85
    {
86
        $this->options = array_merge_recursive($this->getOptions(), $options);
87
88
        return $this;
89
    }
90
91
    /**
92
     * Retrieve the HTTP call options.
93
     *
94
     * @return    array
95
     */
96
    public function getOptions()
97
    {
98
        return $this->options;
99
    }
100
101
    /**
102
     * Set a singular HTTP call option.
103
     *
104
     * @param    string    $option
105
     * @param    mixed    $value
106
     * @return    $this
107
     */
108
    public function setOption($option, $value)
109
    {
110
        $this->options[$option] = $value;
111
112
        return $this;
113
    }
114
115
    /**
116
     * Retrieve a singular HTTP call option.
117
     *
118
     * @param    string    $option
119
     * @return    mixed
120
     */
121
    public function getOption($option)
122
    {
123
        if (isset($this->options[$option])) {
124
            return $this->options[$option];
125
        }
126
127
        return null;
128
    }
129
}
130