Skip to content

Commit 6fc69cc

Browse files
Merge branch '4.4'
* 4.4: Fixed tests on the Security and Form components Add return types to tests and final|internal|private methods
2 parents 6734012 + e61cf3a commit 6fc69cc

File tree

5 files changed

+13
-22
lines changed

5 files changed

+13
-22
lines changed

Authorization/TraceableAccessDecisionManager.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,6 @@ public function addVoterVote(VoterInterface $voter, array $attributes, int $vote
8383
];
8484
}
8585

86-
/**
87-
* @return string
88-
*/
8986
public function getStrategy(): string
9087
{
9188
// The $strategy property is misleading because it stores the name of its
@@ -102,9 +99,6 @@ public function getVoters(): iterable
10299
return $this->voters;
103100
}
104101

105-
/**
106-
* @return array
107-
*/
108102
public function getDecisionLog(): array
109103
{
110104
return $this->decisionLog;

Tests/Authentication/AuthenticationTrustResolverTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public function unserialize($serialized)
131131
{
132132
}
133133

134-
public function __toString()
134+
public function __toString(): string
135135
{
136136
}
137137

@@ -151,11 +151,11 @@ public function setUser($user)
151151
{
152152
}
153153

154-
public function getUsername()
154+
public function getUsername(): string
155155
{
156156
}
157157

158-
public function isAuthenticated()
158+
public function isAuthenticated(): bool
159159
{
160160
}
161161

@@ -167,15 +167,15 @@ public function eraseCredentials()
167167
{
168168
}
169169

170-
public function getAttributes()
170+
public function getAttributes(): array
171171
{
172172
}
173173

174174
public function setAttributes(array $attributes)
175175
{
176176
}
177177

178-
public function hasAttribute(string $name)
178+
public function hasAttribute(string $name): bool
179179
{
180180
}
181181

Tests/Authorization/Voter/VoterTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,12 @@ public function testVote(array $attributes, $expectedVote, $object, $message)
5959

6060
class VoterTest_Voter extends Voter
6161
{
62-
protected function voteOnAttribute(string $attribute, $object, TokenInterface $token)
62+
protected function voteOnAttribute(string $attribute, $object, TokenInterface $token): bool
6363
{
6464
return 'EDIT' === $attribute;
6565
}
6666

67-
protected function supports(string $attribute, $object)
67+
protected function supports(string $attribute, $object): bool
6868
{
6969
return $object instanceof \stdClass && \in_array($attribute, ['EDIT', 'CREATE']);
7070
}

Tests/Encoder/EncoderFactoryTest.php

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

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

142-
public function getPassword()
142+
public function getPassword(): ?string
143143
{
144144
}
145145

146-
public function getSalt()
146+
public function getSalt(): ?string
147147
{
148148
}
149149

150-
public function getUsername()
150+
public function getUsername(): string
151151
{
152152
}
153153

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

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

Tests/User/InMemoryUserProviderTest.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,7 @@ public function testRefresh()
4040
$this->assertFalse($refreshedUser->isCredentialsNonExpired());
4141
}
4242

43-
/**
44-
* @return InMemoryUserProvider
45-
*/
46-
protected function createProvider()
43+
protected function createProvider(): InMemoryUserProvider
4744
{
4845
return new InMemoryUserProvider([
4946
'fabien' => [

0 commit comments

Comments
 (0)