Skip to content

Commit

Permalink
Minor change
Browse files Browse the repository at this point in the history
  • Loading branch information
nguereza-tony committed Oct 16, 2023
1 parent 360426f commit d9feadd
Show file tree
Hide file tree
Showing 16 changed files with 14 additions and 46 deletions.
2 changes: 1 addition & 1 deletion README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![Latest Stable Version](https://poser.pugx.org/platine-php/event-dispatcher/v)](https://packagist.org/packages/platine-php/event-dispatcher)
[![Latest Unstable Version](https://poser.pugx.org/platine-php/event-dispatcher/v/unstable)](https://packagist.org/packages/platine-php/event-dispatcher)
[![License](https://poser.pugx.org/platine-php/event-dispatcher/license)](https://packagist.org/packages/platine-php/event-dispatcher)
[![Build Status](https://img.shields.io/travis/platine-php/event-dispatcher/develop.svg?style=flat-square)](https://travis-ci.com/platine-php/event-dispatcher)
[![Build Status](https://img.shields.io/travis/com/platine-php/event-dispatcher?style=flat-square)](https://travis-ci.com/platine-php/event-dispatcher)
[![Quality Score](https://img.shields.io/scrutinizer/g/platine-php/event-dispatcher.svg?style=flat-square)](https://scrutinizer-ci.com/g/platine-php/event-dispatcher)
[![Maintainability](https://api.codeclimate.com/v1/badges/43a7eda8f7e26dfca6ee/maintainability)](https://codeclimate.com/github/platine-php/event-dispatcher/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/43a7eda8f7e26dfca6ee/test_coverage)](https://codeclimate.com/github/platine-php/event-dispatcher/test_coverage)
Expand Down
16 changes: 0 additions & 16 deletions psalm.xml

This file was deleted.

3 changes: 1 addition & 2 deletions src/CallableListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
* @author Platine Developers Team
* @copyright Copyright (c) 2020
* @license http://opensource.org/licenses/MIT MIT License
* @link http://www.iacademy.cf
* @link https://www.platine-php.com
* @version 1.0.0
* @filesource
*/
Expand All @@ -48,7 +48,6 @@

class CallableListener implements ListenerInterface
{

/**
* The callable
* @var callable
Expand Down
7 changes: 4 additions & 3 deletions src/Dispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
* @author Platine Developers Team
* @copyright Copyright (c) 2020
* @license http://opensource.org/licenses/MIT MIT License
* @link http://www.iacademy.cf
* @link https://www.platine-php.com
* @version 1.0.0
* @filesource
*/
Expand All @@ -50,7 +50,6 @@

class Dispatcher implements DispatcherInterface
{

/**
* The list of listener
* @var array<string, ListenerPriorityQueue>
Expand All @@ -60,7 +59,7 @@ class Dispatcher implements DispatcherInterface
/**
* {@inheritdoc}
*/
public function dispatch($eventName, EventInterface $event = null): void
public function dispatch($eventName, EventInterface $event = null): EventInterface
{
if ($eventName instanceof EventInterface) {
$event = $eventName;
Expand All @@ -77,6 +76,8 @@ public function dispatch($eventName, EventInterface $event = null): void
([$listener, 'handle'])($event);
}
}

return $event;
}

/**
Expand Down
7 changes: 3 additions & 4 deletions src/DispatcherInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
* @author Platine Developers Team
* @copyright Copyright (c) 2020
* @license http://opensource.org/licenses/MIT MIT License
* @link http://www.iacademy.cf
* @link https://www.platine-php.com
* @version 1.0.0
* @filesource
*/
Expand All @@ -50,7 +50,6 @@

interface DispatcherInterface
{

/**
* The low priority
* @var int
Expand All @@ -73,9 +72,9 @@ interface DispatcherInterface
* Dispatches an event to all registered listeners.
* @param string|EventInterface $eventName the name of event of instance of EventInterface
* @param EventInterface|null $event the instance of EventInterface or null
* @return void
* @return EventInterface
*/
public function dispatch($eventName, EventInterface $event = null): void;
public function dispatch($eventName, EventInterface $event = null): EventInterface;

/**
* Register a listener for the given event.
Expand Down
3 changes: 1 addition & 2 deletions src/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
* @author Platine Developers Team
* @copyright Copyright (c) 2020
* @license http://opensource.org/licenses/MIT MIT License
* @link http://www.iacademy.cf
* @link https://www.platine-php.com
* @version 1.0.0
* @filesource
*/
Expand All @@ -49,7 +49,6 @@

class Event implements EventInterface
{

/**
* The event name
* @var string
Expand Down
3 changes: 1 addition & 2 deletions src/EventInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
* @author Platine Developers Team
* @copyright Copyright (c) 2020
* @license http://opensource.org/licenses/MIT MIT License
* @link http://www.iacademy.cf
* @link https://www.platine-php.com
* @version 1.0.0
* @filesource
*/
Expand All @@ -48,7 +48,6 @@

interface EventInterface
{

/**
* Get the event name
* @return string
Expand Down
1 change: 0 additions & 1 deletion src/Exception/DispatcherException.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,4 @@

class DispatcherException extends \Exception
{

}
3 changes: 1 addition & 2 deletions src/ListenerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
* @author Platine Developers Team
* @copyright Copyright (c) 2020
* @license http://opensource.org/licenses/MIT MIT License
* @link http://www.iacademy.cf
* @link https://www.platine-php.com
* @version 1.0.0
* @filesource
*/
Expand All @@ -48,7 +48,6 @@

interface ListenerInterface
{

/**
* Handle event
* @param EventInterface $event the event instance
Expand Down
3 changes: 1 addition & 2 deletions src/ListenerPriorityQueue.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
* @author Platine Developers Team
* @copyright Copyright (c) 2020
* @license http://opensource.org/licenses/MIT MIT License
* @link http://www.iacademy.cf
* @link https://www.platine-php.com
* @version 1.0.0
* @filesource
*/
Expand All @@ -58,7 +58,6 @@
*/
class ListenerPriorityQueue implements IteratorAggregate
{

/**
* The storage
* @var SplObjectStorage<ListenerInterface, int>
Expand Down
3 changes: 1 addition & 2 deletions src/SubscriberInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
* @author Platine Developers Team
* @copyright Copyright (c) 2020
* @license http://opensource.org/licenses/MIT MIT License
* @link http://www.iacademy.cf
* @link https://www.platine-php.com
* @version 1.0.0
* @filesource
*/
Expand All @@ -48,7 +48,6 @@

interface SubscriberInterface
{

/**
* Return the array of event to subscribe in form of
*
Expand Down
1 change: 0 additions & 1 deletion tests/CallableListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
*/
class CallableListenerTest extends PlatineTestCase
{

public function testConstructor(): void
{
$callable = 'Platine\\Test\\Fixture\\callable_listener';
Expand Down
1 change: 0 additions & 1 deletion tests/DispatcherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
*/
class DispatcherTest extends PlatineTestCase
{

public function testAddListenerDefault(): void
{
$d = new Dispatcher();
Expand Down
1 change: 0 additions & 1 deletion tests/EventTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/
class EventTest extends PlatineTestCase
{

public function testConstructor(): void
{
$e = new Event('foo_event');
Expand Down
1 change: 0 additions & 1 deletion tests/ListenerPriorityQueueTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
*/
class ListenerPriorityQueueTest extends PlatineTestCase
{

public function testConstructor(): void
{
//Default values
Expand Down
5 changes: 0 additions & 5 deletions tests/fixtures/fixtures.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

class EventListenerTestClass implements \Platine\Event\ListenerInterface
{

public function handle(\Platine\Event\EventInterface $event)
{
echo $event->getName();
Expand All @@ -15,15 +14,13 @@ public function handle(\Platine\Event\EventInterface $event)

class EventListenerTestClassEmpty implements \Platine\Event\ListenerInterface
{

public function handle(\Platine\Event\EventInterface $event)
{
}
}

class EventListenerTestClassEventInstanceChanged implements \Platine\Event\ListenerInterface
{

public function handle(\Platine\Event\EventInterface $event)
{
$event->setArgument('foo', 'bar');
Expand All @@ -32,7 +29,6 @@ public function handle(\Platine\Event\EventInterface $event)

class EventListenerTestClassStopPropagation implements \Platine\Event\ListenerInterface
{

public function handle(\Platine\Event\EventInterface $event)
{
$event->stopPropagation();
Expand All @@ -41,7 +37,6 @@ public function handle(\Platine\Event\EventInterface $event)

class EventSubscriberTestClass implements \Platine\Event\SubscriberInterface
{

public function getSubscribedEvents(): array
{
return array(
Expand Down

0 comments on commit d9feadd

Please sign in to comment.