Issues (14)

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/SubStatement.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
/*
4
 * This file is part of the xAPI package.
5
 *
6
 * (c) Christian Flothmann <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Xabbuh\XApi\Model;
13
14
/**
15
 * A {@link Statement} included as part of a parent Statement.
16
 *
17
 * @author Christian Flothmann <[email protected]>
18
 */
19
final class SubStatement extends Object
20
{
21
    /**
22
     * @var string The unique identifier
23
     */
24
    private $id;
25
26
    /**
27
     * @var Verb $verb The {@link Verb}
28
     */
29
    private $verb;
30
31
    /**
32
     * @var Actor The {@link Actor}
33
     */
34
    private $actor;
35
36
    /**
37
     * @var Object The {@link Object}
38
     */
39
    private $object;
40
41
    /**
42
     * @var Result The {@link Activity} {@link Result}
43
     */
44
    private $result;
45
46
    public function __construct($id, Actor $actor, Verb $verb, Object $object, Result $result = null)
47
    {
48
        $this->id = $id;
49
        $this->actor = $actor;
50
        $this->verb = $verb;
51
        $this->object = $object;
52
        $this->result = $result;
53
    }
54
55
    /**
56
     * Returns the Statement's unique identifier.
57
     *
58
     * @return string The identifier
59
     */
60
    public function getId()
61
    {
62
        return $this->id;
63
    }
64
65
    /**
66
     * Returns the Statement's {@link Verb}.
67
     *
68
     * @return Verb The Verb
69
     */
70
    public function getVerb()
71
    {
72
        return $this->verb;
73
    }
74
75
    /**
76
     * Returns the Statement's {@link Actor}.
77
     *
78
     * @return Actor The Actor
79
     */
80
    public function getActor()
81
    {
82
        return $this->actor;
83
    }
84
85
    /**
86
     * Returns the Statement's {@link Object}.
87
     *
88
     * @return \Xabbuh\XApi\Model\Object The Object
89
     */
90
    public function getObject()
91
    {
92
        return $this->object;
93
    }
94
95
    /**
96
     * Returns the {@link Activity} {@link Result}.
97
     *
98
     * @return Result The Result
99
     */
100
    public function getResult()
101
    {
102
        return $this->result;
103
    }
104
105
    /**
106
     * Tests whether or not this Statement is a void Statement (i.e. it voids
107
     * another Statement).
108
     *
109
     * @return bool True if the Statement voids another Statement, false otherwise
110
     */
111
    public function isVoidStatement()
112
    {
113
        return $this->verb->isVoidVerb();
114
    }
115
116
    /**
117
     * Returns a {@link StatementReference} for the Statement.
118
     *
119
     * @return StatementReference The reference
120
     */
121
    public function getStatementReference()
122
    {
123
        $reference = new StatementReference($this->id);
124
125
        return $reference;
126
    }
127
128
    /**
129
     * Returns a Statement that voids the current Statement.
130
     *
131
     * @param Actor $actor The Actor voiding this Statement
132
     *
133
     * @return Statement The voiding Statement
134
     */
135
    public function getVoidStatement(Actor $actor)
136
    {
137
        return new Statement(
138
            null,
139
            $actor,
140
            Verb::createVoidVerb(),
141
            $this->getStatementReference()
142
        );
143
    }
144
145
    /**
146
     * {@inheritdoc}
147
     */
148
    public function equals(Object $statement)
149
    {
150
        if ('Xabbuh\XApi\Model\SubStatement' !== get_class($statement)) {
151
            return false;
152
        }
153
154
        /** @var SubStatement $statement */
155
156
        if ($this->id !== $statement->id) {
157
            return false;
158
        }
159
160
        if (!$this->actor->equals($statement->actor)) {
161
            return false;
162
        }
163
164
        if (!$this->verb->equals($statement->verb)) {
165
            return false;
166
        }
167
168
        if (!$this->object->equals($statement->object)) {
169
            return false;
170
        }
171
172
        if (null === $this->result && null !== $statement->result) {
173
            return false;
174
        }
175
176
        if (null !== $this->result && null === $statement->result) {
177
            return false;
178
        }
179
180 View Code Duplication
        if (null !== $this->result && !$this->result->equals($statement->result)) {
0 ignored issues
show
This code seems to be duplicated across 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...
181
            return false;
182
        }
183
184
        return true;
185
    }
186
}
187