Fixed tests on the Security and Form components

This commit is contained in:
Alexander M. Turek 2019-08-21 16:29:27 +02:00 committed by Nicolas Grekas
parent fc186bb78f
commit c39fd9c973
8 changed files with 12 additions and 30 deletions

View File

@ -35,7 +35,7 @@ class User implements UserInterface
$this->name = $name;
}
public function getRoles()
public function getRoles(): array
{
}

View File

@ -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();

View File

@ -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);

View File

@ -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);
}

View File

@ -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;

View File

@ -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;
}

View File

@ -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) {

View File

@ -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;