8000 Fixed tests on the Security and Form components · symfony/symfony@c39fd9c · GitHub
[go: up one dir, main page]

Skip to content

Commit c39fd9c

Browse files
derrabusnicolas-grekas
authored andcommitted
Fixed tests on the Security and Form components
1 parent fc186bb commit c39fd9c

File tree

8 files changed

+12
-30
lines changed

8 files changed

+12
-30
lines changed

src/Symfony/Bridge/Doctrine/Tests/Fixtures/User.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function __construct($id1, $id2, $name)
3535
$this->name = $name;
3636
}
3737

38-
public function getRoles()
38+
public function getRoles(): array
3939
{
4040
}
4141

src/Symfony/Component/BrowserKit/Tests/AbstractBrowserTest.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,7 @@ public function setNextScript($script)
3939
$this->nextScript = $script;
4040
}
4141

42-
/**
43-
* @return object
44-
*/
45-
protected function doRequest($request)
42+
protected function doRequest($request): Response
4643
{
4744
if (null === $this->nextResponse) {
4845
return new Response();
@@ -938,10 +935,7 @@ public function setNextResponse(Response $response)
938935
$this->nextResponse = $response;
939936
}
940937

941-
/**
942-
* @return object
943-
*/
944-
protected function doRequest($request)
938+
protected function doRequest($request): Response
945939
{
946940
if (null === $this->nextResponse) {
947941
return new Response();

src/Symfony/Component/BrowserKit/Tests/HttpBrowserTest.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,7 @@ protected function filterResponse($response): Response
6767
return $response;
6868
}
6969

70-
/**
71-
* @return object
72-
*/
73-
protected function doRequest($request)
70+
protected function doRequest($request): Response
7471
{
7572
$response = parent::doRequest($request);
7673

src/Symfony/Component/EventDispatcher/Tests/LegacyEventDispatcherTest.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,7 @@ protected function createEventDispatcher()
5656

5757
class TestLegacyEventDispatcher extends EventDispatcher
5858
{
59-
/**
60-
* @return object
61-
*/
62-
public function dispatch($eventName, Event $event = null)
59+
public function dispatch($eventName, Event $event = null): Event
6360
{
6461
return parent::dispatch($event, $eventName);
6562
}

src/Symfony/Component/Security/Core/Security.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ public function __construct(ContainerInterface $container)
3434
$this->container = $container;
3535
}
3636

37-
public function getUser(): ?UserInterface
37+
/**
38+
* @return UserInterface|null
39+
*/
40+
public function getUser()
3841
{
3942
if (!$token = $this->getToken()) {
4043
return null;

src/Symfony/Component/Security/Core/Tests/Encoder/EncoderFactoryTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public function testGetEncoderForEncoderAwareWithClassName()
135135

136136
class SomeUser implements UserInterface
137137
{
138-
public function getRoles()
138+
public function getRoles(): array
139139
{
140140
}
141141

@@ -164,7 +164,7 @@ class EncAwareUser extends SomeUser implements EncoderAwareInterface
164164
{
165165
public $encoderName = 'encoder_name';
166166

167-
public function getEncoderName(): string
167+
public function getEncoderName(): ?string
168168
{
169169
return $this->encoderName;
170170
}

src/Symfony/Component/Serializer/Tests/Normalizer/AbstractObjectNormalizerTest.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -301,16 +301,10 @@ public function serialize($data, $format, array $context = []): string
301301
{
302302
}
303303

304-
/**
305-
* @return object
306-
*/
307304
public function deserialize($data, $type, $format, array $context = [])
308305
{
309306
}
310307

311-
/**
312-
* @return object
313-
*/
314308
public function denormalize($data, $type, $format = null, array $context = [])
315309
{
316310
foreach ($this->normalizers as $normalizer) {

src/Symfony/Component/Workflow/Tests/WorkflowTest.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -574,10 +574,7 @@ class EventDispatcherMock implements \Symfony\Component\EventDispatcher\EventDis
574574
{
575575
public $dispatchedEvents = [];
576576

577-
/**
578-
* @return object
579-
*/
580-
public function dispatch($event, string $eventName = null)
577+
public function dispatch($event, string $eventName = null): Event
581578
{
582579
$this->dispatchedEvents[] = $eventName;
583580

0 commit comments

Comments
 (0)
0