Issues (162)

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.

Tests/Fixtures/Test/TestBundle/Document/Client.php (1 issue)

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
namespace Test\TestBundle\Document;
3
4
use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;
5
use Tpg\ExtjsBundle\Annotation as Extjs;
6
use JMS\Serializer\Annotation as JMS;
7
8
/**
9
 * @Extjs\Model(name="Test.document.Client")
10
 * @ODM\Document(collection="client")
11
 */
12
class Client {
13
    /**
14
     * @ODM\Id
15
     * @JMS\Type("string")
16
     */
17
    protected $id;
18
19
    /**
20
     * @ODM\Field(type="string")
21
     * @JMS\Type("string")
22
     */
23
    protected $firstName;
24
25
    /**
26
     * @ODM\String
27
     * @JMS\Type("string")
28
     */
29
    protected $lastName;
30
31
    /**
32
     * @ODM\ReferenceMany(targetDocument="Test\TestBundle\Document\Order", mappedBy="client")
33
     */
34
    protected $orders;
35
36 25
    public function __construct()
37
    {
38 25
        $this->orders = new \Doctrine\Common\Collections\ArrayCollection();
39 25
    }
40
    
41
    /**
42
     * Get id
43
     *
44
     * @return id $id
45
     */
46 4
    public function getId()
47
    {
48 4
        return $this->id;
49
    }
50
51
    /**
52
     * Set firstName
53
     *
54
     * @param string $firstName
55
     * @return self
56
     */
57 25
    public function setFirstName($firstName)
58
    {
59 25
        $this->firstName = $firstName;
60 25
        return $this;
61
    }
62
63
    /**
64
     * Get firstName
65
     *
66
     * @return string $firstName
67
     */
68 1
    public function getFirstName()
69
    {
70 1
        return $this->firstName;
71
    }
72
73
    /**
74
     * Set lastName
75
     *
76
     * @param string $lastName
77
     * @return self
78
     */
79 25
    public function setLastName($lastName)
80
    {
81 25
        $this->lastName = $lastName;
82 25
        return $this;
83
    }
84
85
    /**
86
     * Get lastName
87
     *
88
     * @return string $lastName
89
     */
90
    public function getLastName()
91
    {
92
        return $this->lastName;
93
    }
94
95
    /**
96
     * Add orders
97
     *
98
     * @param Test\TestBundle\Document\Order $orders
99
     *
100
     * @return $this
101
     */
102
    public function addOrder(\Test\TestBundle\Document\Order $orders)
103
    {
104
        $this->orders[] = $orders;
105
        $orders->setClient($this);
106
        return $this;
107
    }
108
109
    /**
110
     * Remove orders
111
     *
112
     * @param Test\TestBundle\Document\Order $orders
113
     */
114
    public function removeOrder(\Test\TestBundle\Document\Order $orders)
115
    {
116
        $this->orders->removeElement($orders);
117
        $orders->setClient(null);
0 ignored issues
show
null is of type null, but the function expects a object<Test\TestBundle\Document\Client>.

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...
118
    }
119
120
    /**
121
     * Get orders
122
     *
123
     * @return Doctrine\Common\Collections\Collection $orders
124
     */
125
    public function getOrders()
126
    {
127
        return $this->orders;
128
    }
129
}
130