Fixed tests on the Security and Form components
This commit is contained in:
parent
fc186bb78f
commit
c39fd9c973
@ -35,7 +35,7 @@ class User implements UserInterface
|
||||
$this->name = $name;
|
||||
}
|
||||
|
||||
public function getRoles()
|
||||
public function getRoles(): array
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -39,10 +39,7 @@ class TestClient extends AbstractBrowser
|
||||
$this->nextScript = $script;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return object
|
||||
*/
|
||||
protected function doRequest($request)
|
||||
protected function doRequest($request): Response
|
||||
{
|
||||
if (null === $this->nextResponse) {
|
||||
return new Response();
|
||||
@ -938,10 +935,7 @@ class ClassThatInheritClient extends AbstractBrowser
|
||||
$this->nextResponse = $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return object
|
||||
*/
|
||||
protected function doRequest($request)
|
||||
protected function doRequest($request): Response
|
||||
{
|
||||
if (null === $this->nextResponse) {
|
||||
return new Response();
|
||||
|
@ -67,10 +67,7 @@ class TestHttpClient extends HttpBrowser
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return object
|
||||
*/
|
||||
protected function doRequest($request)
|
||||
protected function doRequest($request): Response
|
||||
{
|
||||
$response = parent::doRequest($request);
|
||||
|
||||
|
@ -56,10 +56,7 @@ class LegacyEventDispatcherTest extends EventDispatcherTest
|
||||
|
||||
class TestLegacyEventDispatcher extends EventDispatcher
|
||||
{
|
||||
/**
|
||||
* @return object
|
||||
*/
|
||||
public function dispatch($eventName, Event $event = null)
|
||||
public function dispatch($eventName, Event $event = null): Event
|
||||
{
|
||||
return parent::dispatch($event, $eventName);
|
||||
}
|
||||
|
@ -34,7 +34,10 @@ class Security
|
||||
$this->container = $container;
|
||||
}
|
||||
|
||||
public function getUser(): ?UserInterface
|
||||
/**
|
||||
* @return UserInterface|null
|
||||
*/
|
||||
public function getUser()
|
||||
{
|
||||
if (!$token = $this->getToken()) {
|
||||
return null;
|
||||
|
@ -135,7 +135,7 @@ class EncoderFactoryTest extends TestCase
|
||||
|
||||
class SomeUser implements UserInterface
|
||||
{
|
||||
public function getRoles()
|
||||
public function getRoles(): array
|
||||
{
|
||||
}
|
||||
|
||||
@ -164,7 +164,7 @@ class EncAwareUser extends SomeUser implements EncoderAwareInterface
|
||||
{
|
||||
public $encoderName = 'encoder_name';
|
||||
|
||||
public function getEncoderName(): string
|
||||
public function getEncoderName(): ?string
|
||||
{
|
||||
return $this->encoderName;
|
||||
}
|
||||
|
@ -301,16 +301,10 @@ class SerializerCollectionDummy implements SerializerInterface, DenormalizerInte
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @return object
|
||||
*/
|
||||
public function deserialize($data, $type, $format, array $context = [])
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @return object
|
||||
*/
|
||||
public function denormalize($data, $type, $format = null, array $context = [])
|
||||
{
|
||||
foreach ($this->normalizers as $normalizer) {
|
||||
|
@ -574,10 +574,7 @@ class EventDispatcherMock implements \Symfony\Component\EventDispatcher\EventDis
|
||||
{
|
||||
public $dispatchedEvents = [];
|
||||
|
||||
/**
|
||||
* @return object
|
||||
*/
|
||||
public function dispatch($event, string $eventName = null)
|
||||
public function dispatch($event, string $eventName = null): Event
|
||||
{
|
||||
$this->dispatchedEvents[] = $eventName;
|
||||
|
||||
|
Reference in New Issue
Block a user