Skip to content

Commit 3ce1d20

Browse files
committed
minor #32786 add parameter type declarations to private methods (xabbuh)
This PR was merged into the 4.4 branch. Discussion ---------- add parameter type declarations to private methods | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | Commits ------- 1b2aaa4a06 add parameter type declarations to private methods
2 parents b50fa71 + d98c674 commit 3ce1d20

File tree

4 files changed

+6
-11
lines changed

4 files changed

+6
-11
lines changed

Encoder/Argon2iPasswordEncoder.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,12 @@ public function isPasswordValid($encoded, $raw, $salt)
102102
throw new \LogicException('Argon2i algorithm is not supported. Please install the libsodium extension or upgrade to PHP 7.2+.');
103103
}
104104

105-
private function encodePasswordNative($raw)
105+
private function encodePasswordNative(string $raw)
106106
{
107107
return password_hash($raw, \PASSWORD_ARGON2I, $this->config);
108108
}
109109

110-
private function encodePasswordSodiumFunction($raw)
110+
private function encodePasswordSodiumFunction(string $raw)
111111
{
112112
$hash = sodium_crypto_pwhash_str(
113113
$raw,
@@ -119,7 +119,7 @@ private function encodePasswordSodiumFunction($raw)
119119
return $hash;
120120
}
121121

122-
private function encodePasswordSodiumExtension($raw)
122+
private function encodePasswordSodiumExtension(string $raw)
123123
{
124124
$hash = \Sodium\crypto_pwhash_str(
125125
$raw,

Encoder/EncoderFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ private function createEncoder(array $config)
8282
return $reflection->newInstanceArgs($config['arguments']);
8383
}
8484

85-
private function getEncoderConfigFromAlgorithm($config)
85+
private function getEncoderConfigFromAlgorithm(array $config)
8686
{
8787
if ('auto' === $config['algorithm']) {
8888
$encoderChain = [];

User/InMemoryUserProvider.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,11 @@ public function supportsClass($class)
9393
/**
9494
* Returns the user by given username.
9595
*
96-
* @param string $username The username
97-
*
9896
* @return User
9997
*
10098
* @throws UsernameNotFoundException if user whose given username does not exist
10199
*/
102-
private function getUser($username)
100+
private function getUser(string $username)
103101
{
104102
if (!isset($this->users[strtolower($username)])) {
105103
$ex = new UsernameNotFoundException(sprintf('Username "%s" does not exist.', $username));

User/LdapUserProvider.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,8 @@ protected function loadUser($username, Entry $entry)
140140

141141
/**
142142
* Fetches a required unique attribute value from an LDAP entry.
143-
*
144-
* @param Entry|null $entry
145-
* @param string $attribute
146143
*/
147-
private function getAttributeValue(Entry $entry, $attribute)
144+
private function getAttributeValue(Entry $entry, string $attribute)
148145
{
149146
if (!$entry->hasAttribute($attribute)) {
150147
throw new InvalidArgumentException(sprintf('Missing attribute "%s" for user "%s".', $attribute, $entry->getDn()));

0 commit comments

Comments
 (0)