Issues (118)

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.

Messaging/Model/Message.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 MilioooMessageBundle package.
5
 *
6
 * (c) Michiel boeckaert <[email protected]>
7
 * This source file is subject to the MIT license that is bundled
8
 * with this source code in the file LICENSE.
9
 */
10
11
namespace Miliooo\Messaging\Model;
12
13
use Miliooo\Messaging\User\ParticipantInterface;
14
use Miliooo\Messaging\Model\MessageMetaInterface;
15
use Doctrine\Common\Collections\ArrayCollection;
16
use Miliooo\Messaging\Model\ThreadInterface;
17
18
/**
19
 * The message model
20
 *
21
 * @author Michiel Boeckaert <[email protected]>
22
 */
23
abstract class Message implements MessageInterface
0 ignored issues
show
Message does not seem to conform to the naming convention (^Abstract|Factory$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
24
{
25
    /**
26
     * The unique id of the message
27
     *
28
     * @var integer The unique id of the message
29
     */
30
    protected $id;
31
32
    /**
33
     * The creation time of the message
34
     *
35
     * @var \DateTime
36
     */
37
    protected $createdAt;
38
39
    /**
40
     * The sender of the message
41
     *
42
     * @var ParticipantInterface
43
     */
44
    protected $sender;
45
46
    /**
47
     * The body of the message
48
     *
49
     * @var string
50
     */
51
    protected $body;
52
53
    /**
54
     * A collection of message metas
55
     *
56
     * @var ArrayCollection
57
     */
58
    protected $messageMeta;
59
60
    /**
61
     * The thread this message belongs to
62
     *
63
     * @var ThreadInterface
64
     */
65
    protected $thread;
66
67
    /**
68
     * Constructor.
69
     */
70
    public function __construct()
71
    {
72
        $this->messageMeta = new ArrayCollection();
73
    }
74
75
    /**
76
     * {@inheritdoc}
77
     */
78
    public function getId()
79
    {
80
        return $this->id;
81
    }
82
83
    /**
84
     * {@inheritdoc}
85
     */
86
    public function setCreatedAt(\DateTime $createdAt)
87
    {
88
        $this->createdAt = $createdAt;
89
    }
90
91
    /**
92
     * {@inheritdoc}
93
     */
94
    public function getCreatedAt()
95
    {
96
        return $this->createdAt;
97
    }
98
99
    /**
100
     * {@inheritdoc}
101
     */
102
    public function getBody()
103
    {
104
        return $this->body;
105
    }
106
107
    /**
108
     * {@inheritdoc}
109
     */
110
    public function setBody($body)
111
    {
112
        $this->body = $body;
113
    }
114
115
    /**
116
     * {@inheritdoc}
117
     */
118
    public function setSender(ParticipantInterface $sender)
119
    {
120
        $this->sender = $sender;
121
    }
122
123
    /**
124
     * {@inheritdoc}
125
     */
126
    public function getSender()
127
    {
128
        return $this->sender;
129
    }
130
131
    /**
132
     * {@inheritdoc}
133
     */
134
    public function addMessageMeta(MessageMetaInterface $messageMeta)
135
    {
136
        $messageMeta->setMessage($this);
137
        $this->messageMeta->add($messageMeta);
138
    }
139
140
    /**
141
     * {@inheritdoc}
142
     */
143
    public function getMessageMeta()
144
    {
145
        return $this->messageMeta;
146
    }
147
148
    /**
149
     * {@inheritdoc}
150
     */
151
    public function getMessageMetaForParticipant(ParticipantInterface $participant)
152
    {
153
        foreach ($this->messageMeta as $meta) {
154
            if ($meta->getParticipant()->getParticipantId() === $participant->getParticipantId()) {
155
                return $meta;
156
            }
157
        }
158
159
        return null;
160
    }
161
162
    /**
163
     * {@inheritdoc}
164
     */
165
    public function setThread(ThreadInterface $thread)
166
    {
167
        $this->thread = $thread;
168
    }
169
170
    /**
171
     * {@inheritdoc}
172
     */
173
    public function getThread()
174
    {
175
        return $this->thread;
176
    }
177
}
178