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

Skip to content

Commit c46dbe0

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

File tree

6 files changed

+10
-4
lines changed

6 files changed

+10
-4
lines changed

src/Symfony/Component/Form/Tests/Extension/Validator/EventListener/ValidationListenerTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
use Symfony\Component\Form\FormFactoryInterface;
2727
use Symfony\Component\Validator\ConstraintViolation;
2828
use Symfony\Component\Validator\ConstraintViolationInterface;
29+
use Symfony\Component\Validator\ConstraintViolationList;
2930
use Symfony\Component\Validator\ConstraintViolationListInterface;
3031
use Symfony\Component\Validator\Context\ExecutionContextInterface;
3132
use Symfony\Component\Validator\Mapping\MetadataInterface;
@@ -169,7 +170,7 @@ public function hasMetadataFor($value): bool
169170

170171
public function validate($value, $constraints = null, $groups = null): ConstraintViolationListInterface
171172
{
172-
return [$this->violation];
173+
return new ConstraintViolationList([$this->violation]);
173174
}
174175

175176
public function validateProperty($object, $propertyName, $groups = null): ConstraintViolationListInterface

src/Symfony/Component/Form/Tests/Fixtures/FooType.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@ class FooType extends AbstractType
1717
{
1818
public function getParent(): ?string
1919
{
20+
return null;
2021
}
2122
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ interface EncoderAwareInterface
2222
* If the method returns null, the standard way to retrieve the encoder
2323
* will be used instead.
2424
*
25-
* @return string
25+
* @return string|null
2626
*/
2727
public function getEncoderName();
2828
}

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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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/Security/Core/User/User.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ public function getPassword(): ?string
7171
*/
7272
public function getSalt(): ?string
7373
{
74+
return null;
7475
}
7576

7677
/**

0 commit comments

Comments
 (0)
0