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/Manager/ReadStatusManagerEventAware.php (2 issues)

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
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\Manager;
12
13
use Miliooo\Messaging\User\ParticipantInterface;
14
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
15
use Miliooo\Messaging\Event\MilioooMessagingEvents;
16
use Miliooo\Messaging\Model\MessageInterface;
17
use Miliooo\Messaging\Event\ReadStatusMessageEvent;
18
use Miliooo\Messaging\ValueObjects\ReadStatus;
19
20
/**
21
 * Read status manager who dispatches read status updates events.
22
 *
23
 * This class uses the decorator pattern.
24
 * The read status manager returns an array with updated messages.
25
 * This class uses this array to dispatch events for these updated messages.
26
 * Since it implements the same interface it also has to return this array.
27
 *
28
 * @author Michiel Boeckaert <[email protected]>
29
 */
30
class ReadStatusManagerEventAware implements ReadStatusManagerInterface
31
{
32
    /**
33
     * A read status manager instance.
34
     *
35
     * @var ReadStatusManagerInterface
36
     */
37
    private $readStatusManager;
38
39
    /**
40
     * An event dispatcher instance.
41
     *
42
     * @var EventDispatcherInterface
43
     */
44
    private $eventDispatcher;
45
46
    /**
47
     * Constructor.
48
     *
49
     * @param ReadStatusManagerInterface $readStatusManager
50
     * @param EventDispatcherInterface   $eventDispatcher
51
     */
52
    public function __construct(
53
        ReadStatusManagerInterface $readStatusManager,
54
        EventDispatcherInterface $eventDispatcher
55
    ) {
56
        $this->readStatusManager = $readStatusManager;
57
        $this->eventDispatcher = $eventDispatcher;
58
    }
59
60
    /**
61
     * {@inheritdoc}
62
     */
63
    public function updateReadStatusForMessageCollection(
0 ignored issues
show
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
64
        ReadStatus $updatedReadStatus,
65
        ParticipantInterface $participant,
66
        $messages = []
67
    ) {
68
69
        $updatedMessages = $this->readStatusManager->updateReadStatusForMessageCollection(
70
            $updatedReadStatus,
71
            $participant,
72
            $messages
73
        );
74
75
        $this->maybeDispatchMessages($updatedMessages, $participant);
76
77
        return $updatedMessages;
78
    }
79
80
    /**
81
     * Looping over the updated messages (if any) and dispatching them.
82
     *
83
     * @param MessageInterface[]|[] $updatedMessages An array with message interfaces or an empty array if none updated
0 ignored issues
show
The doc-type MessageInterface[]|[] could not be parsed: Unknown type name "" at position 19. [(view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
84
     * @param ParticipantInterface  $participant     The participant for whom we updated the messages
85
     */
86
    protected function maybeDispatchMessages($updatedMessages, $participant)
87
    {
88
        foreach ($updatedMessages as $message) {
89
            $this->dispatchMessage($message, $participant);
90
        }
91
    }
92
93
    /**
94
     * Dispatch a read status changed event.
95
     *
96
     * @param MessageInterface     $message     The message whom read status is changed for the participant
97
     * @param ParticipantInterface $participant The participant for whom the read status is changed.
98
     */
99
    protected function dispatchMessage(MessageInterface $message, ParticipantInterface $participant)
100
    {
101
        $event = new ReadStatusMessageEvent($message, $participant);
102
        $this->eventDispatcher->dispatch(MilioooMessagingEvents::READ_STATUS_CHANGED, $event);
103
    }
104
}
105