Skip to content

Commit

Permalink
Apply fixtures commit
Browse files Browse the repository at this point in the history
  • Loading branch information
divineniiquaye committed May 20, 2020
1 parent f900de9 commit 340d158
Show file tree
Hide file tree
Showing 11 changed files with 446 additions and 504 deletions.
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ sudo: false

matrix:
include:
- php: 7.2
env: SCRUTINIZER=1
env: COMPOSER_FLAGS="--prefer-lowest"
- php: 7.2
- php: 7.3
- php: nightly
allow_failures:
Expand All @@ -22,7 +22,6 @@ install:
before_install:
- composer self-update
- phpenv config-rm xdebug.ini || true
- composer require phpunit/phpunit ^7.5

before_script:
- composer update $COMPOSER_FLAGS --prefer-dist
Expand Down
7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,23 @@
"require": {
"php": "^7.2",
"psr/log": "^1.1",
"biurad/biurad-helpers": "^0.1",
"symfony/event-dispatcher-contracts": "^1.1|^2"
},
"require-dev": {
"phpunit/phpunit": "~7.0"
"phpunit/phpunit": "^8.4"
},
"autoload": {
"psr-4": {
"BiuradPHP\\Event\\": "src/"
"BiuradPHP\\Events\\": "src/"
},
"exclude-from-classmap": [
"/Tests/"
]
},
"autoload-dev": {
"psr-4": {
"BiuradPHP\\Event\\Tests\\": "Tests/"
"BiuradPHP\\Events\\Tests\\": "Tests/"
}
},
"minimum-stability": "dev",
Expand Down
3 changes: 1 addition & 2 deletions src/Concerns/StoppableTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ trait StoppableTrait
* This will typically only be used by the Dispatcher to determine if the
* previous listener halted propagation.
*
* @return bool
* True if the Event is complete and no further listeners should be called.
* @return bool True if the Event is complete and no further listeners should be called.
* False to continue calling listeners.
*/
public function isPropagationStopped(): bool
Expand Down
22 changes: 6 additions & 16 deletions src/EventAnnotation.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@

namespace BiuradPHP\Events;

use BiuradPHP\Events\Interfaces\EventBroadcastInterface;
use BiuradPHP\Events\Interfaces\EventDispatcherInterface;
use BiuradPHP\Events\Interfaces\EventSubscriberInterface;
use BiuradPHP\Loader\AnnotationLocator;
use BiuradPHP\Loader\Annotations\AnnotationLoader;
use BiuradPHP\Loader\Interfaces\AnnotationInterface;
use ReflectionClass;
use ReflectionMethod;
Expand Down Expand Up @@ -81,22 +80,13 @@ public function __construct(EventDispatcherInterface $events)
/**
* Load the annoatation for events.
*
* @param AnnotationLocator $annotation
* @param AnnotationLoader $annotation
*/
public function register(AnnotationLocator $annotation): void
public function register(AnnotationLoader $annotation): void
{
/**
* @var ReflectionClass $reflector
* @var Annotation\Listener $classAnnotation
*/
foreach ($annotation->findClasses($this->eventAnnotationClass) as [$reflector, $classAnnotation]) {
if ($reflector->implementsInterface(EventBroadcastInterface::class)) {
$this->events->addListener(
$classAnnotation->getEvent(),
$reflector->getName(),
$classAnnotation->getPriority()
);
} elseif ($reflector->implementsInterface(EventSubscriberInterface::class)) {
/** @var ReflectionClass $reflector */
foreach ($annotation->findClasses($this->eventAnnotationClass) as [$reflector,]) {
if ($reflector->implementsInterface(EventSubscriberInterface::class)) {
$this->events->addSubscriber($reflector->getName());
}
}
Expand Down
158 changes: 0 additions & 158 deletions src/EventContext.php

This file was deleted.

Loading

0 comments on commit 340d158

Please sign in to comment.