Merge branch '4.4'
* 4.4: fix merge [Debug] Remove superfluous deprecation notice Add missing return annotations on magic methods Fix mocks for ImmutableEventDispatcher.
This commit is contained in:
commit
9a84484a5c
@ -83,6 +83,8 @@ class Cookie
|
||||
|
||||
/**
|
||||
* Returns the HTTP representation of the Cookie.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
|
@ -59,6 +59,9 @@ class ReferenceConfigurator extends AbstractConfigurator
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return $this->id;
|
||||
|
@ -33,6 +33,9 @@ class Variable
|
||||
$this->name = $name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return $this->name;
|
||||
|
@ -40,15 +40,14 @@ class ImmutableEventDispatcherTest extends TestCase
|
||||
public function testDispatchDelegates()
|
||||
{
|
||||
$event = new Event();
|
||||
$expectedResult = new class() {
|
||||
};
|
||||
$resultEvent = new Event();
|
||||
|
||||
$this->innerDispatcher->expects($this->once())
|
||||
->method('dispatch')
|
||||
->with($event, 'event')
|
||||
->willReturn($expectedResult);
|
||||
->willReturn($resultEvent);
|
||||
|
||||
$this->assertSame($expectedResult, $this->dispatcher->dispatch($event, 'event'));
|
||||
$this->assertSame($resultEvent, $this->dispatcher->dispatch($event, 'event'));
|
||||
}
|
||||
|
||||
public function testGetListenersDelegates()
|
||||
@ -56,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()
|
||||
@ -66,9 +65,9 @@ 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'));
|
||||
}
|
||||
|
||||
public function testAddListenerDisallowed()
|
||||
|
@ -33,6 +33,9 @@ class Node
|
||||
$this->attributes = $attributes;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
$attributes = [];
|
||||
|
@ -91,6 +91,9 @@ abstract class DataCollector implements DataCollectorInterface
|
||||
return $casters;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function __sleep()
|
||||
{
|
||||
return ['data'];
|
||||
|
@ -795,6 +795,9 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function __sleep()
|
||||
{
|
||||
return ['environment', 'debug'];
|
||||
|
@ -260,6 +260,9 @@ class Profile
|
||||
return isset($this->collectors[$name]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function __sleep()
|
||||
{
|
||||
return ['token', 'parent', 'children', 'collectors', 'ip', 'method', 'url', 'time', 'statusCode'];
|
||||
|
@ -125,6 +125,9 @@ class DataPart extends TextPart
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function __sleep()
|
||||
{
|
||||
// converts the body to a string
|
||||
|
@ -179,6 +179,9 @@ class TextPart extends AbstractPart
|
||||
return 'quoted-printable';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function __sleep()
|
||||
{
|
||||
// convert resources to strings for serialization
|
||||
|
@ -26,6 +26,9 @@ class ConstStub extends Stub
|
||||
$this->value = 1 < \func_num_args() ? $value : $name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return (string) $this->value;
|
||||
|
@ -137,6 +137,9 @@ class Data implements \ArrayAccess, \Countable, \IteratorAggregate
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function __isset($key)
|
||||
{
|
||||
return null !== $this->seek($key);
|
||||
@ -165,6 +168,9 @@ class Data implements \ArrayAccess, \Countable, \IteratorAggregate
|
||||
throw new \BadMethodCallException(self::class.' objects are immutable.');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
$value = $this->getValue();
|
||||
|
Reference in New Issue
Block a user