Issues (18)

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/Adapters/AbstractEventDispatcher.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
 * This file is part of Laravel HTTP Adapter.
5
 *
6
 * (c) Hidde Beydals <[email protected]>, Mark Redeman
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 HiddeCo\HttpAdapter\Adapters;
13
14
use Symfony\Component\EventDispatcher\Event;
15
use Symfony\Component\EventDispatcher\EventDispatcherInterface as SymfonyDispatcher;
16
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
17
18
/**
19
 * This adapter provides a Laravel integration for applications
20
 * using the Symfony EventDispatcherInterface.
21
 *
22
 * It passes any request on to a Symfony Dispatcher and only
23
 * uses the Laravel Dispatcher when dispatching events.
24
 */
25
abstract class AbstractEventDispatcher implements SymfonyDispatcher
26
{
27
    /**
28
     * The Laravel Events Dispatcher.
29
     *
30
     * @var \Illuminate\Contracts\Events\Dispatcher|\Illuminate\Events\Dispatcher
31
     */
32
    protected $laravelDispatcher;
33
34
    /**
35
     * The Symfony Event Dispatcher.
36
     *
37
     * @var \Symfony\Component\EventDispatcher\EventDispatcherInterface
38
     */
39
    protected $symfonyDispatcher;
40
41
    /**
42
     * Dispatches an event to all registered listeners.
43
     *
44
     * @param string $eventName The name of the event to dispatch. The name of
45
     *                          the event is the name of the method that is
46
     *                          invoked on listeners.
47
     * @param Event  $event     The event to pass to the event handlers/listeners.
48
     *                          If not supplied, an empty Event instance is created.
49
     *
50
     * @return Event
51
     */
52
    public function dispatch($eventName, Event $event = null)
53
    {
54
        if ($event === null) {
55
            $event = new Event();
56
        }
57
58
        $event->setName($eventName);
0 ignored issues
show
Deprecated Code introduced by
The method Symfony\Component\EventDispatcher\Event::setName() has been deprecated with message: since version 2.4, to be removed in 3.0. The event name is passed to the listener call.

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
59
        $event->setDispatcher($this);
0 ignored issues
show
Deprecated Code introduced by
The method Symfony\Component\EventD...\Event::setDispatcher() has been deprecated with message: since version 2.4, to be removed in 3.0. The event dispatcher is passed to the listener call.

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
60
61
        $this->laravelDispatcher->fire($eventName, $event);
62
        $this->symfonyDispatcher->dispatch($eventName, $event);
63
64
        $event->setDispatcher($this);
0 ignored issues
show
Deprecated Code introduced by
The method Symfony\Component\EventD...\Event::setDispatcher() has been deprecated with message: since version 2.4, to be removed in 3.0. The event dispatcher is passed to the listener call.

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
65
66
        return $event;
67
    }
68
69
    /**
70
     * Adds an event listener that listens on the specified events.
71
     *
72
     * @param string   $eventName The event to listen on
73
     * @param callable $listener  The listener
74
     * @param int      $priority  The higher this value, the earlier an event
75
     *                            listener will be triggered in the chain.
76
     */
77
    public function addListener($eventName, $listener, $priority = 0)
78
    {
79
        $this->symfonyDispatcher->addListener($eventName, $listener, $priority);
80
    }
81
82
    /**
83
     * Adds an event subscriber.
84
     *
85
     * The subscriber is asked for all the events he is
86
     * interested in and added as a listener for these events.
87
     *
88
     * @param EventSubscriberInterface $subscriber The subscriber.
89
     */
90
    public function addSubscriber(EventSubscriberInterface $subscriber)
91
    {
92
        $this->symfonyDispatcher->addSubscriber($subscriber);
93
    }
94
95
    /**
96
     * Removes an event listener from the specified events.
97
     *
98
     * @param string   $eventName           The event to remove a listener from
99
     * @param callable $listenerToBeRemoved The listener to remove
100
     */
101
    public function removeListener($eventName, $listenerToBeRemoved)
102
    {
103
        $this->symfonyDispatcher->removeListener($eventName, $listenerToBeRemoved);
104
    }
105
106
    /**
107
     * Removes an event subscriber.
108
     *
109
     * @param EventSubscriberInterface $subscriber The subscriber
110
     */
111
    public function removeSubscriber(EventSubscriberInterface $subscriber)
112
    {
113
        $this->symfonyDispatcher->removeSubscriber($subscriber);
114
    }
115
116
    /**
117
     * Gets the listeners of a specific event or all listeners.
118
     *
119
     * @param string $eventName The name of the event
120
     *
121
     * @return array The event listeners for the specified event, or all event listeners by event name
122
     */
123
    public function getListeners($eventName = null)
124
    {
125
        return $this->symfonyDispatcher->getListeners($eventName);
126
    }
127
128
    /**
129
     * Checks whether an event has any registered listeners.
130
     *
131
     * @param string $eventName The name of the event
132
     *
133
     * @return bool true if the specified event has any listeners, false otherwise
134
     */
135
    public function hasListeners($eventName = null)
136
    {
137
        return ($this->symfonyDispatcher->hasListeners($eventName) ||
138
            $this->laravelDispatcher->hasListeners($eventName));
139
    }
140
}
141