Issues (199)

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.

code/classes/DMSRequestItem.php (3 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
/**
4
 * Class DMSRequestItem wrapper which represents a DocumentCartItem
5
 */
6
class DMSRequestItem extends ViewableData
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
7
{
8
    /**
9
     * The number of copies required of @itemID
10
     *
11
     * @var int
12
     */
13
    private $quantity;
14
15
    /**
16
     * The linked {@link DMSDocument} which was added to the cart.
17
     *
18
     * @var DMSDocument
19
     */
20
    private $document;
21
22
    /**
23
     * If a document is provided on construction, set it to this item instance
24
     *
25
     * @param DMSDocument $document
0 ignored issues
show
Should the type for parameter $document not be DMSDocument|null?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
26
     */
27
    public function __construct($document = null)
28
    {
29
        if ($document instanceof DMSDocument) {
30
            $this->setDocument($document);
31
        }
32
        parent::__construct();
33
    }
34
35
    /**
36
     * Returns the ID of the $this->document
37
     *
38
     * @return int
39
     */
40
    public function getItemId()
41
    {
42
        return $this->document->ID;
43
    }
44
45
    /**
46
     * Returns the linked item Quantity
47
     *
48
     * @return int
49
     */
50
    public function getQuantity()
51
    {
52
        return $this->quantity;
53
    }
54
55
    /**
56
     * Sets the quantity of documents to be ordered.
57
     *
58
     * @param int $quantity
59
     *
60
     * @return DMSRequestItem
61
     */
62
    public function setQuantity($quantity)
63
    {
64
        $this->quantity = (int) $quantity;
65
66
        return $this;
67
    }
68
69
    /**
70
     * Returns the linked DMSDocument
71
     *
72
     * @return DMSDocument
0 ignored issues
show
Should the return type not be DMSDocument|null?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
73
     */
74
    public function getDocument()
75
    {
76
        if ($this->document) {
77
            return DMSDocument::get()->byID($this->document->ID);
78
        }
79
    }
80
81
    /**
82
     * @param DMSDocument $document
83
     *
84
     * @return DMSRequestItem
85
     */
86
    public function setDocument($document)
87
    {
88
        $this->document = $document;
89
90
        return $this;
91
    }
92
}
93