summaryrefslogtreecommitdiff
path: root/vendor/symfony/event-dispatcher
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@webtrees.net>2019-09-07 08:17:24 +0100
committerGreg Roach <fisharebest@webtrees.net>2019-09-07 08:17:24 +0100
commit43e2cc54543d9f79c9805f752e78e25c351646ff (patch)
treef8f252a8f0f6ff6061c177456865102c50a04810 /vendor/symfony/event-dispatcher
parent4e96702fabf715ae955aafd54002fb5c57a109cf (diff)
downloadwebtrees-43e2cc54543d9f79c9805f752e78e25c351646ff.tar.gz
webtrees-43e2cc54543d9f79c9805f752e78e25c351646ff.tar.bz2
webtrees-43e2cc54543d9f79c9805f752e78e25c351646ff.zip
Update vendor dependencies
Diffstat (limited to 'vendor/symfony/event-dispatcher')
-rw-r--r--vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php2
-rw-r--r--vendor/symfony/event-dispatcher/EventDispatcher.php4
-rw-r--r--vendor/symfony/event-dispatcher/LegacyEventDispatcherProxy.php2
-rw-r--r--vendor/symfony/event-dispatcher/Tests/DependencyInjection/RegisterListenersPassTest.php21
-rw-r--r--vendor/symfony/event-dispatcher/Tests/EventDispatcherTest.php12
-rw-r--r--vendor/symfony/event-dispatcher/Tests/EventTest.php4
-rw-r--r--vendor/symfony/event-dispatcher/Tests/GenericEventTest.php16
-rw-r--r--vendor/symfony/event-dispatcher/Tests/ImmutableEventDispatcherTest.php34
-rw-r--r--vendor/symfony/event-dispatcher/Tests/LegacyEventDispatcherTest.php6
9 files changed, 43 insertions, 58 deletions
diff --git a/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php b/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php
index 2da03e82c1..513c6ade6d 100644
--- a/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php
+++ b/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php
@@ -13,12 +13,12 @@ namespace Symfony\Component\EventDispatcher\Debug;
use Psr\EventDispatcher\StoppableEventInterface;
use Psr\Log\LoggerInterface;
-use Symfony\Component\BrowserKit\Request;
use Symfony\Component\EventDispatcher\Event;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\EventDispatcher\LegacyEventDispatcherProxy;
use Symfony\Component\EventDispatcher\LegacyEventProxy;
+use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\Stopwatch\Stopwatch;
use Symfony\Contracts\EventDispatcher\Event as ContractsEvent;
diff --git a/vendor/symfony/event-dispatcher/EventDispatcher.php b/vendor/symfony/event-dispatcher/EventDispatcher.php
index a5f0b7eda5..ebfd1ec6d5 100644
--- a/vendor/symfony/event-dispatcher/EventDispatcher.php
+++ b/vendor/symfony/event-dispatcher/EventDispatcher.php
@@ -108,7 +108,7 @@ class EventDispatcher implements EventDispatcherInterface
public function getListenerPriority($eventName, $listener)
{
if (empty($this->listeners[$eventName])) {
- return;
+ return null;
}
if (\is_array($listener) && isset($listener[0]) && $listener[0] instanceof \Closure) {
@@ -125,6 +125,8 @@ class EventDispatcher implements EventDispatcherInterface
}
}
}
+
+ return null;
}
/**
diff --git a/vendor/symfony/event-dispatcher/LegacyEventDispatcherProxy.php b/vendor/symfony/event-dispatcher/LegacyEventDispatcherProxy.php
index afa3e988d0..be0d381a29 100644
--- a/vendor/symfony/event-dispatcher/LegacyEventDispatcherProxy.php
+++ b/vendor/symfony/event-dispatcher/LegacyEventDispatcherProxy.php
@@ -50,6 +50,8 @@ final class LegacyEventDispatcherProxy implements EventDispatcherInterface
* {@inheritdoc}
*
* @param string|null $eventName
+ *
+ * @return object
*/
public function dispatch($event/*, string $eventName = null*/)
{
diff --git a/vendor/symfony/event-dispatcher/Tests/DependencyInjection/RegisterListenersPassTest.php b/vendor/symfony/event-dispatcher/Tests/DependencyInjection/RegisterListenersPassTest.php
index d665f426e0..2e238bc5ef 100644
--- a/vendor/symfony/event-dispatcher/Tests/DependencyInjection/RegisterListenersPassTest.php
+++ b/vendor/symfony/event-dispatcher/Tests/DependencyInjection/RegisterListenersPassTest.php
@@ -22,11 +22,10 @@ class RegisterListenersPassTest extends TestCase
/**
* Tests that event subscribers not implementing EventSubscriberInterface
* trigger an exception.
- *
- * @expectedException \InvalidArgumentException
*/
public function testEventSubscriberWithoutInterface()
{
+ $this->expectException('InvalidArgumentException');
$builder = new ContainerBuilder();
$builder->register('event_dispatcher');
$builder->register('my_event_subscriber', 'stdClass')
@@ -63,12 +62,10 @@ class RegisterListenersPassTest extends TestCase
$this->assertEquals($expectedCalls, $eventDispatcherDefinition->getMethodCalls());
}
- /**
- * @expectedException \InvalidArgumentException
- * @expectedExceptionMessage The service "foo" tagged "kernel.event_listener" must not be abstract.
- */
public function testAbstractEventListener()
{
+ $this->expectException('InvalidArgumentException');
+ $this->expectExceptionMessage('The service "foo" tagged "kernel.event_listener" must not be abstract.');
$container = new ContainerBuilder();
$container->register('foo', 'stdClass')->setAbstract(true)->addTag('kernel.event_listener', []);
$container->register('event_dispatcher', 'stdClass');
@@ -77,12 +74,10 @@ class RegisterListenersPassTest extends TestCase
$registerListenersPass->process($container);
}
- /**
- * @expectedException \InvalidArgumentException
- * @expectedExceptionMessage The service "foo" tagged "kernel.event_subscriber" must not be abstract.
- */
public function testAbstractEventSubscriber()
{
+ $this->expectException('InvalidArgumentException');
+ $this->expectExceptionMessage('The service "foo" tagged "kernel.event_subscriber" must not be abstract.');
$container = new ContainerBuilder();
$container->register('foo', 'stdClass')->setAbstract(true)->addTag('kernel.event_subscriber', []);
$container->register('event_dispatcher', 'stdClass');
@@ -128,12 +123,10 @@ class RegisterListenersPassTest extends TestCase
$this->assertTrue($container->getDefinition('foo')->hasTag('container.hot_path'));
}
- /**
- * @expectedException \InvalidArgumentException
- * @expectedExceptionMessage You have requested a non-existent parameter "subscriber.class"
- */
public function testEventSubscriberUnresolvableClassName()
{
+ $this->expectException('InvalidArgumentException');
+ $this->expectExceptionMessage('You have requested a non-existent parameter "subscriber.class"');
$container = new ContainerBuilder();
$container->register('foo', '%subscriber.class%')->addTag('kernel.event_subscriber', []);
$container->register('event_dispatcher', 'stdClass');
diff --git a/vendor/symfony/event-dispatcher/Tests/EventDispatcherTest.php b/vendor/symfony/event-dispatcher/Tests/EventDispatcherTest.php
index 658a941239..83d10a89be 100644
--- a/vendor/symfony/event-dispatcher/Tests/EventDispatcherTest.php
+++ b/vendor/symfony/event-dispatcher/Tests/EventDispatcherTest.php
@@ -32,13 +32,13 @@ class EventDispatcherTest extends TestCase
private $listener;
- protected function setUp()
+ protected function setUp(): void
{
$this->dispatcher = $this->createEventDispatcher();
$this->listener = new TestEventListener();
}
- protected function tearDown()
+ protected function tearDown(): void
{
$this->dispatcher = null;
$this->listener = null;
@@ -285,7 +285,7 @@ class EventDispatcherTest extends TestCase
}
/**
- * @see https://bugs.php.net/bug.php?id=62976
+ * @see https://bugs.php.net/62976
*
* This bug affects:
* - The PHP 5.3 branch for versions < 5.3.18
@@ -431,12 +431,10 @@ class EventDispatcherTest extends TestCase
$this->dispatcher->dispatch('foo', new Event());
}
- /**
- * @expectedException \TypeError
- * @expectedExceptionMessage Argument 1 passed to "Symfony\Component\EventDispatcher\EventDispatcherInterface::dispatch()" must be an object, string given.
- */
public function testLegacySignatureWithNewEventObject()
{
+ $this->expectException('TypeError');
+ $this->expectExceptionMessage('Argument 1 passed to "Symfony\Component\EventDispatcher\EventDispatcherInterface::dispatch()" must be an object, string given.');
$this->dispatcher->dispatch('foo', new ContractsEvent());
}
}
diff --git a/vendor/symfony/event-dispatcher/Tests/EventTest.php b/vendor/symfony/event-dispatcher/Tests/EventTest.php
index ca8e945c64..34ed3ba70e 100644
--- a/vendor/symfony/event-dispatcher/Tests/EventTest.php
+++ b/vendor/symfony/event-dispatcher/Tests/EventTest.php
@@ -28,7 +28,7 @@ class EventTest extends TestCase
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->event = new Event();
}
@@ -37,7 +37,7 @@ class EventTest extends TestCase
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*/
- protected function tearDown()
+ protected function tearDown(): void
{
$this->event = null;
}
diff --git a/vendor/symfony/event-dispatcher/Tests/GenericEventTest.php b/vendor/symfony/event-dispatcher/Tests/GenericEventTest.php
index e9e011a29d..484e1a5f3e 100644
--- a/vendor/symfony/event-dispatcher/Tests/GenericEventTest.php
+++ b/vendor/symfony/event-dispatcher/Tests/GenericEventTest.php
@@ -29,7 +29,7 @@ class GenericEventTest extends TestCase
/**
* Prepares the environment before running a test.
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->subject = new \stdClass();
$this->event = new GenericEvent($this->subject, ['name' => 'Event']);
@@ -38,7 +38,7 @@ class GenericEventTest extends TestCase
/**
* Cleans up the environment after running a test.
*/
- protected function tearDown()
+ protected function tearDown(): void
{
$this->subject = null;
$this->event = null;
@@ -61,14 +61,14 @@ class GenericEventTest extends TestCase
public function testSetArguments()
{
$result = $this->event->setArguments(['foo' => 'bar']);
- $this->assertAttributeSame(['foo' => 'bar'], 'arguments', $this->event);
+ $this->assertSame(['foo' => 'bar'], $this->event->getArguments());
$this->assertSame($this->event, $result);
}
public function testSetArgument()
{
$result = $this->event->setArgument('foo2', 'bar2');
- $this->assertAttributeSame(['name' => 'Event', 'foo2' => 'bar2'], 'arguments', $this->event);
+ $this->assertSame(['name' => 'Event', 'foo2' => 'bar2'], $this->event->getArguments());
$this->assertEquals($this->event, $result);
}
@@ -78,11 +78,9 @@ class GenericEventTest extends TestCase
$this->assertEquals('Event', $this->event->getArgument('name'));
}
- /**
- * @expectedException \InvalidArgumentException
- */
public function testGetArgException()
{
+ $this->expectException('\InvalidArgumentException');
$this->event->getArgument('nameNotExist');
}
@@ -99,13 +97,13 @@ class GenericEventTest extends TestCase
public function testOffsetSet()
{
$this->event['foo2'] = 'bar2';
- $this->assertAttributeSame(['name' => 'Event', 'foo2' => 'bar2'], 'arguments', $this->event);
+ $this->assertSame(['name' => 'Event', 'foo2' => 'bar2'], $this->event->getArguments());
}
public function testOffsetUnset()
{
unset($this->event['name']);
- $this->assertAttributeSame([], 'arguments', $this->event);
+ $this->assertSame([], $this->event->getArguments());
}
public function testOffsetIsset()
diff --git a/vendor/symfony/event-dispatcher/Tests/ImmutableEventDispatcherTest.php b/vendor/symfony/event-dispatcher/Tests/ImmutableEventDispatcherTest.php
index f6556f0b1b..edce6f199d 100644
--- a/vendor/symfony/event-dispatcher/Tests/ImmutableEventDispatcherTest.php
+++ b/vendor/symfony/event-dispatcher/Tests/ImmutableEventDispatcherTest.php
@@ -11,6 +11,7 @@
namespace Symfony\Component\EventDispatcher\Tests;
+use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
use Symfony\Component\EventDispatcher\Event;
use Symfony\Component\EventDispatcher\ImmutableEventDispatcher;
@@ -21,7 +22,7 @@ use Symfony\Component\EventDispatcher\ImmutableEventDispatcher;
class ImmutableEventDispatcherTest extends TestCase
{
/**
- * @var \PHPUnit_Framework_MockObject_MockObject
+ * @var MockObject
*/
private $innerDispatcher;
@@ -30,7 +31,7 @@ class ImmutableEventDispatcherTest extends TestCase
*/
private $dispatcher;
- protected function setUp()
+ protected function setUp(): void
{
$this->innerDispatcher = $this->getMockBuilder('Symfony\Component\EventDispatcher\EventDispatcherInterface')->getMock();
$this->dispatcher = new ImmutableEventDispatcher($this->innerDispatcher);
@@ -39,13 +40,14 @@ class ImmutableEventDispatcherTest extends TestCase
public function testDispatchDelegates()
{
$event = new Event();
+ $resultEvent = new Event();
$this->innerDispatcher->expects($this->once())
->method('dispatch')
->with($event, 'event')
- ->willReturn('result');
+ ->willReturn($resultEvent);
- $this->assertSame('result', $this->dispatcher->dispatch($event, 'event'));
+ $this->assertSame($resultEvent, $this->dispatcher->dispatch('event', $event));
}
public function testGetListenersDelegates()
@@ -53,9 +55,9 @@ class ImmutableEventDispatcherTest extends TestCase
$this->innerDispatcher->expects($this->once())
->method('getListeners')
->with('event')
- ->willReturn('result');
+ ->willReturn(['result']);
- $this->assertSame('result', $this->dispatcher->getListeners('event'));
+ $this->assertSame(['result'], $this->dispatcher->getListeners('event'));
}
public function testHasListenersDelegates()
@@ -63,42 +65,34 @@ class ImmutableEventDispatcherTest extends TestCase
$this->innerDispatcher->expects($this->once())
->method('hasListeners')
->with('event')
- ->willReturn('result');
+ ->willReturn(true);
- $this->assertSame('result', $this->dispatcher->hasListeners('event'));
+ $this->assertTrue($this->dispatcher->hasListeners('event'));
}
- /**
- * @expectedException \BadMethodCallException
- */
public function testAddListenerDisallowed()
{
+ $this->expectException('\BadMethodCallException');
$this->dispatcher->addListener('event', function () { return 'foo'; });
}
- /**
- * @expectedException \BadMethodCallException
- */
public function testAddSubscriberDisallowed()
{
+ $this->expectException('\BadMethodCallException');
$subscriber = $this->getMockBuilder('Symfony\Component\EventDispatcher\EventSubscriberInterface')->getMock();
$this->dispatcher->addSubscriber($subscriber);
}
- /**
- * @expectedException \BadMethodCallException
- */
public function testRemoveListenerDisallowed()
{
+ $this->expectException('\BadMethodCallException');
$this->dispatcher->removeListener('event', function () { return 'foo'; });
}
- /**
- * @expectedException \BadMethodCallException
- */
public function testRemoveSubscriberDisallowed()
{
+ $this->expectException('\BadMethodCallException');
$subscriber = $this->getMockBuilder('Symfony\Component\EventDispatcher\EventSubscriberInterface')->getMock();
$this->dispatcher->removeSubscriber($subscriber);
diff --git a/vendor/symfony/event-dispatcher/Tests/LegacyEventDispatcherTest.php b/vendor/symfony/event-dispatcher/Tests/LegacyEventDispatcherTest.php
index ffa767cf8b..30bd0c3346 100644
--- a/vendor/symfony/event-dispatcher/Tests/LegacyEventDispatcherTest.php
+++ b/vendor/symfony/event-dispatcher/Tests/LegacyEventDispatcherTest.php
@@ -41,12 +41,10 @@ class LegacyEventDispatcherTest extends EventDispatcherTest
$this->createEventDispatcher()->dispatch('foo', new Event());
}
- /**
- * @expectedException \TypeError
- * @expectedExceptionMessage Argument 1 passed to "Symfony\Contracts\EventDispatcher\EventDispatcherInterface::dispatch()" must be an object, string given.
- */
public function testLegacySignatureWithNewEventObject()
{
+ $this->expectException('TypeError');
+ $this->expectExceptionMessage('Argument 1 passed to "Symfony\Contracts\EventDispatcher\EventDispatcherInterface::dispatch()" must be an object, string given.');
$this->createEventDispatcher()->dispatch('foo', new ContractsEvent());
}