Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1627583

Browse filesBrowse files
Merge branch '3.4' into 4.4
* 3.4: fix typo [Validator] clarify stringable type annotations [Security/Core] fix some annotations
2 parents 1893ef9 + 523f5c0 commit 1627583
Copy full SHA for 1627583

8 files changed

+46-35Lines changed: 46 additions & 35 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/Symfony/Component/Security/Core/Authentication/Token/AbstractToken.php‎

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Core/Authentication/Token/AbstractToken.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ abstract class AbstractToken implements TokenInterface
3131
private $attributes = [];
3232

3333
/**
34-
* @param string[] $roles An array of roles
34+
* @param (Role|string)[] $roles An array of roles
3535
*
3636
* @throws \InvalidArgumentException
3737
*/
@@ -41,7 +41,7 @@ public function __construct(array $roles = [])
4141
if (\is_string($role)) {
4242
$role = new Role($role, false);
4343
} elseif (!$role instanceof Role) {
44-
throw new \InvalidArgumentException(sprintf('$roles must be an array of strings, or Role instances, but got %s.', \gettype($role)));
44+
throw new \InvalidArgumentException(sprintf('$roles must be an array of strings or Role instances, but got %s.', \gettype($role)));
4545
}
4646

4747
$this->roles[] = $role;
Collapse file

‎src/Symfony/Component/Security/Core/Authentication/Token/AnonymousToken.php‎

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Core/Authentication/Token/AnonymousToken.php
+6-3Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111

1212
namespace Symfony\Component\Security\Core\Authentication\Token;
1313

14+
use Symfony\Component\Security\Core\Role\Role;
15+
use Symfony\Component\Security\Core\User\UserInterface;
16+
1417
/**
1518
* AnonymousToken represents an anonymous token.
1619
*
@@ -21,9 +24,9 @@ class AnonymousToken extends AbstractToken
2124
private $secret;
2225

2326
/**
24-
* @param string $secret A secret used to make sure the token is created by the app and not by a malicious client
25-
* @param string|object $user The user can be a UserInterface instance, or an object implementing a __toString method or the username as a regular string
26-
* @param string[] $roles An array of roles
27+
* @param string $secret A secret used to make sure the token is created by the app and not by a malicious client
28+
* @param string|\Stringable|UserInterface $user
29+
* @param (Role|string)[] $roles
2730
*/
2831
public function __construct(string $secret, $user, array $roles = [])
2932
{
Collapse file

‎src/Symfony/Component/Security/Core/Authentication/Token/PreAuthenticatedToken.php‎

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Core/Authentication/Token/PreAuthenticatedToken.php
+7-4Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111

1212
namespace Symfony\Component\Security\Core\Authentication\Token;
1313

14+
use Symfony\Component\Security\Core\Role\Role;
15+
use Symfony\Component\Security\Core\User\UserInterface;
16+
1417
/**
1518
* PreAuthenticatedToken implements a pre-authenticated token.
1619
*
@@ -22,10 +25,10 @@ class PreAuthenticatedToken extends AbstractToken
2225
private $providerKey;
2326

2427
/**
25-
* @param string|object $user The user can be a UserInterface instance, or an object implementing a __toString method or the username as a regular string
26-
* @param mixed $credentials The user credentials
27-
* @param string $providerKey The provider key
28-
* @param string[] $roles An array of roles
28+
* @param string|\Stringable|UserInterface $user
29+
* @param mixed $credentials
30+
* @param string $providerKey
31+
* @param (Role|string)[] $roles
2932
*/
3033
public function __construct($user, $credentials, string $providerKey, array $roles = [])
3134
{
Collapse file

‎src/Symfony/Component/Security/Core/Authentication/Token/TokenInterface.php‎

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Core/Authentication/Token/TokenInterface.php
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Component\Security\Core\Authentication\Token;
1313

1414
use Symfony\Component\Security\Core\Role\Role;
15+
use Symfony\Component\Security\Core\User\UserInterface;
1516

1617
/**
1718
* TokenInterface is the interface for the user authentication information.
@@ -53,8 +54,7 @@ public function getCredentials();
5354
/**
5455
* Returns a user representation.
5556
*
56-
* @return string|object Can be a UserInterface instance, an object implementing a __toString method,
57-
* or the username as a regular string
57+
* @return string|\Stringable|UserInterface
5858
*
5959
* @see AbstractToken::setUser()
6060
*/
@@ -66,7 +66,7 @@ public function getUser();
6666
* The user can be a UserInterface instance, or an object implementing
6767
* a __toString method or the username as a regular string.
6868
*
69-
* @param string|object $user The user
69+
* @param string|\Stringable|UserInterface $user
7070
*
7171
* @throws \InvalidArgumentException
7272
*/
Collapse file

‎src/Symfony/Component/Security/Core/Authentication/Token/UsernamePasswordToken.php‎

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Core/Authentication/Token/UsernamePasswordToken.php
+7-4Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111

1212
namespace Symfony\Component\Security\Core\Authentication\Token;
1313

14+
use Symfony\Component\Security\Core\Role\Role;
15+
use Symfony\Component\Security\Core\User\UserInterface;
16+
1417
/**
1518
* UsernamePasswordToken implements a username and password token.
1619
*
@@ -22,10 +25,10 @@ class UsernamePasswordToken extends AbstractToken
2225
private $providerKey;
2326

2427
/**
25-
* @param string|object $user The username (like a nickname, email address, etc.), or a UserInterface instance or an object implementing a __toString method
26-
* @param mixed $credentials This usually is the password of the user
27-
* @param string $providerKey The provider key
28-
* @param string[] $roles An array of roles
28+
* @param string|\Stringable|UserInterface $user The username (like a nickname, email address, etc.) or a UserInterface instance
29+
* @param mixed $credentials
30+
* @param string $providerKey
31+
* @param (Role|string)[] $roles
2932
*
3033
* @throws \InvalidArgumentException
3134
*/
Collapse file

‎src/Symfony/Component/Validator/ConstraintViolation.php‎

Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/ConstraintViolation.php
+16-14Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,22 @@ class ConstraintViolation implements ConstraintViolationInterface
3232
/**
3333
* Creates a new constraint violation.
3434
*
35-
* @param string|object $message The violation message as a string or a stringable object
36-
* @param string $messageTemplate The raw violation message
37-
* @param array $parameters The parameters to substitute in the
38-
* raw violation message
39-
* @param mixed $root The value originally passed to the
40-
* validator
41-
* @param string $propertyPath The property path from the root
42-
* value to the invalid value
43-
* @param mixed $invalidValue The invalid value that caused this
44-
* violation
45-
* @param int|null $plural The number for determining the plural
46-
* form when translating the message
47-
* @param string|null $code The error code of the violation
48-
* @param mixed $cause The cause of the violation
35+
* @param string|\Stringable $message The violation message as a string or a stringable object
36+
* @param string $messageTemplate The raw violation message
37+
* @param array $parameters The parameters to substitute in the
38+
* raw violation message
39+
* @param mixed $root The value originally passed to the
40+
* validator
41+
* @param string $propertyPath The property path from the root
42+
* value to the invalid value
43+
* @param mixed $invalidValue The invalid value that caused this
44+
* violation
45+
* @param int|null $plural The number for determining the plural
46+
* form when translating the message
47+
* @param mixed $code The error code of the violation
48+
* @param Constraint|null $constraint The constraint whose validation
49+
* caused the violation
50+
* @param mixed $cause The cause of the violation
4951
*/
5052
public function __construct($message, ?string $messageTemplate, array $parameters, $root, ?string $propertyPath, $invalidValue, int $plural = null, $code = null, Constraint $constraint = null, $cause = null)
5153
{
Collapse file

‎src/Symfony/Component/Validator/ConstraintViolationInterface.php‎

Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/ConstraintViolationInterface.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ interface ConstraintViolationInterface
3636
/**
3737
* Returns the violation message.
3838
*
39-
* @return string|object The violation message as a string or a stringable object
39+
* @return string|\Stringable The violation message as a string or a stringable object
4040
*/
4141
public function getMessage();
4242

Collapse file

‎src/Symfony/Component/Validator/Context/ExecutionContextInterface.php‎

Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/Context/ExecutionContextInterface.php
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ interface ExecutionContextInterface
6464
/**
6565
* Adds a violation at the current node of the validation graph.
6666
*
67-
* @param string|object $message The error message as a string or a stringable object
68-
* @param array $params The parameters substituted in the error message
67+
* @param string|\Stringable $message The error message as a string or a stringable object
68+
* @param array $params The parameters substituted in the error message
6969
*/
7070
public function addViolation($message, array $params = []);
7171

@@ -81,8 +81,8 @@ public function addViolation($message, array $params = []);
8181
* ->setTranslationDomain('number_validation')
8282
* ->addViolation();
8383
*
84-
* @param string|object $message The error message as a string or a stringable object
85-
* @param array $parameters The parameters substituted in the error message
84+
* @param string|\Stringable $message The error message as a string or a stringable object
85+
* @param array $parameters The parameters substituted in the error message
8686
*
8787
* @return ConstraintViolationBuilderInterface The violation builder
8888
*/

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.