Issues (21)

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/Endpoints/People.php (1 issue)

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 JulianoBailao\DomusApi\Endpoints;
4
5
use JulianoBailao\DomusApi\Contracts\CreationContract;
6
use JulianoBailao\DomusApi\Contracts\GetContract;
7
use JulianoBailao\DomusApi\Core\Endpoint;
8
use JulianoBailao\DomusApi\Data\PersonData;
9
10
class People extends Endpoint implements GetContract, CreationContract
11
{
12
    /**
13
     * Get a page of people list.
14
     *
15
     * @param array $query the request query string.
16
     *
17
     * @return stdClass
18
     */
19 3
    public function paginate(array $query = [])
20
    {
21 3
        return $this->page('operacional/pessoas', $query);
22
    }
23
24
    /**
25
     * Get a specific person.
26
     *
27
     * @param int $id the person id.
28
     *
29
     * @return stdClass
30
     */
31 3
    public function get($id)
32
    {
33 3
        return $this->run('GET', 'pedidovenda-rest/pessoas/'.$id);
34
    }
35
36
    /**
37
     * Check if the document already exists.
38
     *
39
     * @param string $documentNumber
40
     *
41
     * @return stdClass
42
     */
43 3
    public function document($documentNumber)
44
    {
45 3
        return $this->run('GET', 'pedidovenda-rest/pessoas/documento', ['query' => ['num' => $documentNumber]]);
46
    }
47
48
    /**
49
     * Validate the document.
50
     *
51
     * @param string $documentNumber
52
     *
53
     * @return stdClass
54
     */
55 3
    public function validateDocument($documentNumber)
56
    {
57 3
        return $this->run('GET', 'pedidovenda-rest/pessoas/validarDocumento', ['query' => ['num' => $documentNumber]]);
58
    }
59
60
    /**
61
     * Get the delivery address from a person.
62
     *
63
     * @param int $id
64
     *
65
     * @return stdClass
66
     */
67 3
    public function deliveryAddresses($id)
68
    {
69 3
        return $this->run('GET', 'pedidovenda-rest/pessoas/'.$id.'/enderecosentrega');
70
    }
71
72
    /**
73
     * Get the default values from a person.
74
     *
75
     * @param int $id
76
     *
77
     * @return stdClass
78
     */
79 3
    public function defaultValues($id)
80
    {
81 3
        return $this->run('GET', 'pedidovenda-rest/pessoas/'.$id.'/valoresPadraoPedido');
82
    }
83
84
    /**
85
     * Create a new person.
86
     *
87
     * @return PersonData
88
     */
89 3
    public function create()
90
    {
91 3
        return new PersonData($this);
92
    }
93
94
    /**
95
     * Update a existing person.
96
     *
97
     * @param int $id
98
     *
99
     * @return stdClass
100
     */
101 3
    public function update($id)
102
    {
103 3
        return new PersonData($this, $id);
104
    }
105
106
    /**
107
     * Send the save request.
108
     *
109
     * @param PersonData $data
110
     *
111
     * @return stdClass
112
     */
113 6 View Code Duplication
    public function save(PersonData $data)
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
114
    {
115 6
        $id = $data->getId();
116
117 6
        return $this->run(
118 6
            $id == null ? 'POST' : 'PUT',
119 6
            'pedidovenda-rest/pessoas'.($id > 0 ? '/'.$id : null),
120 6
            ['json' => $data->toArray()]
121 6
        );
122
    }
123
}
124