Skip to content

Commit a22cc49

Browse files
committed
Merge branch '2.4'
* 2.4: (35 commits) Update validators.ro.xlf add non-standard port to HTTP_HOST fixed attribute "source-language" for translations [Process] clarify idle timeout [Security] fix DI for SimpleFormAuthenticationListener Update PluralizationRules.php Update validators.pt_BR.xlf Translated remaining items (57-72) Updated Vietnamese translation allow null value in fragment handler added missing dot in translation updated Arabic translations Update validators.id.xlf [Validator] Translate validator messages into Brazilian Portuguese Added more Swedish validator translations Update validators.ca.xlf fixed typos in Welsh translation Added missing Croatian translations [Form] fixed allow render 0 and 0.0 numeric input values Fixed validators.nl.xlf ... Conflicts: src/Symfony/Bridge/Twig/composer.json
2 parents 72f8a1b + d32b0b4 commit a22cc49

15 files changed

+94
-41
lines changed

Authentication/Provider/RememberMeAuthenticationProvider.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,23 @@ class RememberMeAuthenticationProvider implements AuthenticationProviderInterfac
2222
private $key;
2323
private $providerKey;
2424

25+
/**
26+
* Constructor.
27+
*
28+
* @param UserCheckerInterface $userChecker An UserCheckerInterface interface
29+
* @param string $key A key
30+
* @param string $providerKey A provider key
31+
*/
2532
public function __construct(UserCheckerInterface $userChecker, $key, $providerKey)
2633
{
2734
$this->userChecker = $userChecker;
2835
$this->key = $key;
2936
$this->providerKey = $providerKey;
3037
}
3138

39+
/**
40+
* {@inheritdoc}
41+
*/
3242
public function authenticate(TokenInterface $token)
3343
{
3444
if (!$this->supports($token)) {
@@ -48,6 +58,9 @@ public function authenticate(TokenInterface $token)
4858
return $authenticatedToken;
4959
}
5060

61+
/**
62+
* {@inheritdoc}
63+
*/
5164
public function supports(TokenInterface $token)
5265
{
5366
return $token instanceof RememberMeToken && $token->getProviderKey() === $this->providerKey;

Authentication/RememberMe/InMemoryTokenProvider.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ class InMemoryTokenProvider implements TokenProviderInterface
2222
{
2323
private $tokens = array();
2424

25+
/**
26+
* {@inheritdoc}
27+
*/
2528
public function loadTokenBySeries($series)
2629
{
2730
if (!isset($this->tokens[$series])) {
@@ -31,6 +34,9 @@ public function loadTokenBySeries($series)
3134
return $this->tokens[$series];
3235
}
3336

37+
/**
38+
* {@inheritdoc}
39+
*/
3440
public function updateToken($series, $tokenValue, \DateTime $lastUsed)
3541
{
3642
if (!isset($this->tokens[$series])) {
@@ -47,11 +53,17 @@ public function updateToken($series, $tokenValue, \DateTime $lastUsed)
4753
$this->tokens[$series] = $token;
4854
}
4955

56+
/**
57+
* {@inheritdoc}
58+
*/
5059
public function deleteTokenBySeries($series)
5160
{
5261
unset($this->tokens[$series]);
5362
}
5463

64+
/**
65+
* {@inheritdoc}
66+
*/
5567
public function createNewToken(PersistentTokenInterface $token)
5668
{
5769
$this->tokens[$token->getSeries()] = $token;

Authentication/RememberMe/PersistentToken.php

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -58,49 +58,39 @@ public function __construct($class, $username, $series, $tokenValue, \DateTime $
5858
}
5959

6060
/**
61-
* Returns the class of the user
62-
*
63-
* @return string
61+
* {@inheritdoc}
6462
*/
6563
public function getClass()
6664
{
6765
return $this->class;
6866
}
6967

7068
/**
71-
* Returns the username
72-
*
73-
* @return string
69+
* {@inheritdoc}
7470
*/
7571
public function getUsername()
7672
{
7773
return $this->username;
7874
}
7975

8076
/**
81-
* Returns the series
82-
*
83-
* @return string
77+
* {@inheritdoc}
8478
*/
8579
public function getSeries()
8680
{
8781
return $this->series;
8882
}
8983

9084
/**
91-
* Returns the token value
92-
*
93-
* @return string
85+
* {@inheritdoc}
9486
*/
9587
public function getTokenValue()
9688
{
9789
return $this->tokenValue;
9890
}
9991

10092
/**
101-
* Returns the time the token was last used
102-
*
103-
* @return \DateTime
93+
* {@inheritdoc}
10494
*/
10595
public function getLastUsed()
10696
{

Authentication/RememberMe/PersistentTokenInterface.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,31 +20,36 @@
2020
interface PersistentTokenInterface
2121
{
2222
/**
23-
* Returns the class of the user
23+
* Returns the class of the user.
24+
*
2425
* @return string
2526
*/
2627
public function getClass();
2728

2829
/**
29-
* Returns the username
30+
* Returns the username.
31+
*
3032
* @return string
3133
*/
3234
public function getUsername();
3335

3436
/**
35-
* Returns the series
37+
* Returns the series.
38+
*
3639
* @return string
3740
*/
3841
public function getSeries();
3942

4043
/**
41-
* Returns the token value
44+
* Returns the token value.
45+
*
4246
* @return string
4347
*/
4448
public function getTokenValue();
4549

4650
/**
47-
* Returns the last time the cookie was used
51+
* Returns the time the token was last used.
52+
*
4853
* @return \DateTime
4954
*/
5055
public function getLastUsed();

Authentication/Token/AbstractToken.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ public function getUsername()
7070
return (string) $this->user;
7171
}
7272

73+
/**
74+
* {@inheritdoc}
75+
*/
7376
public function getUser()
7477
{
7578
return $this->user;

Authentication/Token/AnonymousToken.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
*
1919
* @author Fabien Potencier <[email protected]>
2020
*/
21-
2221
class AnonymousToken extends AbstractToken
2322
{
2423
private $key;

Authentication/Token/PreAuthenticatedToken.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,19 @@ public function __construct($user, $credentials, $providerKey, array $roles = ar
4141
}
4242
}
4343

44+
/**
45+
* Returns the provider key.
46+
*
47+
* @return string The provider key
48+
*/
4449
public function getProviderKey()
4550
{
4651
return $this->providerKey;
4752
}
4853

54+
/**
55+
* {@inheritdoc}
56+
*/
4957
public function getCredentials()
5058
{
5159
return $this->credentials;
@@ -61,11 +69,17 @@ public function eraseCredentials()
6169
$this->credentials = null;
6270
}
6371

72+
/**
73+
* {@inheritdoc}
74+
*/
6475
public function serialize()
6576
{
6677
return serialize(array($this->credentials, $this->providerKey, parent::serialize()));
6778
}
6879

80+
/**
81+
* {@inheritdoc}
82+
*/
6983
public function unserialize($str)
7084
{
7185
list($this->credentials, $this->providerKey, $parentStr) = unserialize($str);

Authentication/Token/RememberMeToken.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ public function __construct(UserInterface $user, $providerKey, $key)
5151
parent::setAuthenticated(true);
5252
}
5353

54+
/**
55+
* {@inheritdoc}
56+
*/
5457
public function setAuthenticated($authenticated)
5558
{
5659
if ($authenticated) {
@@ -60,16 +63,29 @@ public function setAuthenticated($authenticated)
6063
parent::setAuthenticated(false);
6164
}
6265

66+
/**
67+
* Returns the provider key.
68+
*
69+
* @return string The provider key
70+
*/
6371
public function getProviderKey()
6472
{
6573
return $this->providerKey;
6674
}
6775

76+
/**
77+
* Returns the key.
78+
*
79+
* @return string The Key
80+
*/
6881
public function getKey()
6982
{
7083
return $this->key;
7184
}
7285

86+
/**
87+
* {@inheritdoc}
88+
*/
7389
public function getCredentials()
7490
{
7591
return '';

Authentication/Token/UsernamePasswordToken.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,19 @@ public function setAuthenticated($isAuthenticated)
6060
parent::setAuthenticated(false);
6161
}
6262

63+
/**
64+
* {@inheritdoc}
65+
*/
6366
public function getCredentials()
6467
{
6568
return $this->credentials;
6669
}
6770

71+
/**
72+
* Returns the provider key.
73+
*
74+
* @return string The provider key
75+
*/
6876
public function getProviderKey()
6977
{
7078
return $this->providerKey;

Role/RoleHierarchy.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,7 @@ public function __construct(array $hierarchy)
3434
}
3535

3636
/**
37-
* Returns an array of all roles reachable by the given ones.
38-
*
39-
* @param RoleInterface[] $roles An array of RoleInterface instances
40-
*
41-
* @return RoleInterface[] An array of RoleInterface instances
37+
* {@inheritdoc}
4238
*/
4339
public function getReachableRoles(array $roles)
4440
{

Role/RoleHierarchyInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
interface RoleHierarchyInterface
2020
{
2121
/**
22-
* Returns an array of all reachable roles.
22+
* Returns an array of all reachable roles by the given ones.
2323
*
2424
* Reachable roles are the roles directly assigned but also all roles that
2525
* are transitively reachable from them in the role hierarchy.

SecurityContext.php

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,9 @@ public function __construct(AuthenticationManagerInterface $authenticationManage
4646
}
4747

4848
/**
49-
* Checks if the attributes are granted against the current token.
49+
* {@inheritdoc}
5050
*
5151
* @throws AuthenticationCredentialsNotFoundException when the security context has no authentication token.
52-
*
53-
* @param mixed $attributes
54-
* @param mixed|null $object
55-
*
56-
* @return Boolean
5752
*/
5853
final public function isGranted($attributes, $object = null)
5954
{
@@ -73,19 +68,15 @@ final public function isGranted($attributes, $object = null)
7368
}
7469

7570
/**
76-
* Gets the currently authenticated token.
77-
*
78-
* @return TokenInterface|null A TokenInterface instance or null if no authentication information is available
71+
* {@inheritdoc}
7972
*/
8073
public function getToken()
8174
{
8275
return $this->token;
8376
}
8477

8578
/**
86-
* Sets the currently authenticated token.
87-
*
88-
* @param TokenInterface $token A TokenInterface token, or null if no further authentication information should be stored
79+
* {@inheritdoc}
8980
*/
9081
public function setToken(TokenInterface $token = null)
9182
{

SecurityContextInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ public function getToken();
3434
/**
3535
* Sets the authentication token.
3636
*
37-
* @param TokenInterface $token
37+
* @param TokenInterface $token A TokenInterface token, or null if no further authentication information should be stored
3838
*/
3939
public function setToken(TokenInterface $token = null);
4040

4141
/**
4242
* Checks if the attributes are granted against the current authentication token and optionally supplied object.
4343
*
44-
* @param array $attributes
44+
* @param mixed $attributes
4545
* @param mixed $object
4646
*
4747
* @return Boolean

Validator/Constraints/UserPassword.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ class UserPassword extends Constraint
2121
public $message = 'This value should be the user current password.';
2222
public $service = 'security.validator.user_password';
2323

24+
/**
25+
* {@inheritdoc}
26+
*/
2427
public function validatedBy()
2528
{
2629
return $this->service;

Validator/Constraints/UserPasswordValidator.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ public function __construct(SecurityContextInterface $securityContext, EncoderFa
2929
$this->encoderFactory = $encoderFactory;
3030
}
3131

32+
/**
33+
* {@inheritdoc}
34+
*/
3235
public function validate($password, Constraint $constraint)
3336
{
3437
$user = $this->securityContext->getToken()->getUser();

0 commit comments

Comments
 (0)