Skip to content

Commit 2c21845

Browse files
committed
Merge branch '2.7' into 2.8
* 2.7: fixed CS fixed CS fixed CS Fix WebProfilerBundle compatiblity with HttpKernel < 2.7 [Validator] Deprecated PHP7-incompatible constraints and related validators [DebugBundle] Allow alternative destination for dumps [DebugBundle] Use output mechanism of dumpers instead of echoing [DebugBundle] Always collect dumps [FrameworkBundle] Applied new styles to the config:debug & config:dump-reference commands Fix tests in HHVM CS: Pre incrementation/decrementation should be used if possible Conflicts: src/Symfony/Bundle/FrameworkBundle/composer.json
2 parents 455862a + af39a58 commit 2c21845

File tree

8 files changed

+17
-17
lines changed

8 files changed

+17
-17
lines changed

Authentication/Provider/PreAuthenticatedAuthenticationProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function authenticate(TokenInterface $token)
6060
throw new BadCredentialsException('No pre-authenticated principal found in request.');
6161
}
6262

63-
$user = $this->userProvider->loadUserByUsername($user);
63+
$user = $this->userProvider->loadUserByUsername($user);
6464

6565
$this->userChecker->checkPostAuth($user);
6666

Encoder/MessageDigestPasswordEncoder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function encodePassword($raw, $salt)
5555
$digest = hash($this->algorithm, $salted, true);
5656

5757
// "stretch" hash
58-
for ($i = 1; $i < $this->iterations; $i++) {
58+
for ($i = 1; $i < $this->iterations; ++$i) {
5959
$digest = hash($this->algorithm, $digest.$salted, true);
6060
}
6161

Encoder/Pbkdf2PasswordEncoder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,11 @@ private function hashPbkdf2($algorithm, $password, $salt, $iterations, $length =
8787
$blocks = ceil($length / strlen(hash($algorithm, null, true)));
8888
$digest = '';
8989

90-
for ($i = 1; $i <= $blocks; $i++) {
90+
for ($i = 1; $i <= $blocks; ++$i) {
9191
$ib = $block = hash_hmac($algorithm, $salt.pack('N', $i), $password, true);
9292

9393
// Iterations
94-
for ($j = 1; $j < $iterations; $j++) {
94+
for ($j = 1; $j < $iterations; ++$j) {
9595
$ib ^= ($block = hash_hmac($algorithm, $block, $password, true));
9696
}
9797

Tests/Authorization/AccessDecisionManagerTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,13 +153,13 @@ public function getStrategyTests()
153153
protected function getVoters($grants, $denies, $abstains)
154154
{
155155
$voters = array();
156-
for ($i = 0; $i < $grants; $i++) {
156+
for ($i = 0; $i < $grants; ++$i) {
157157
$voters[] = $this->getVoter(VoterInterface::ACCESS_GRANTED);
158158
}
159-
for ($i = 0; $i < $denies; $i++) {
159+
for ($i = 0; $i < $denies; ++$i) {
160160
$voters[] = $this->getVoter(VoterInterface::ACCESS_DENIED);
161161
}
162-
for ($i = 0; $i < $abstains; $i++) {
162+
for ($i = 0; $i < $abstains; ++$i) {
163163
$voters[] = $this->getVoter(VoterInterface::ACCESS_ABSTAIN);
164164
}
165165

Tests/Encoder/BCryptPasswordEncoderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function testCostAboveRange()
4040

4141
public function testCostInRange()
4242
{
43-
for ($cost = 4; $cost <= 31; $cost++) {
43+
for ($cost = 4; $cost <= 31; ++$cost) {
4444
new BCryptPasswordEncoder($cost);
4545
}
4646
}

Tests/Util/SecureRandomTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,17 @@ public function testPoker($secureRandom)
3535
{
3636
$b = $this->getBitSequence($secureRandom, 20000);
3737
$c = array();
38-
for ($i = 0; $i <= 15; $i++) {
38+
for ($i = 0; $i <= 15; ++$i) {
3939
$c[$i] = 0;
4040
}
4141

42-
for ($j = 1; $j <= 5000; $j++) {
42+
for ($j = 1; $j <= 5000; ++$j) {
4343
$k = 4 * $j - 1;
4444
++$c[8 * $b[$k - 3] + 4 * $b[$k - 2] + 2 * $b[$k - 1] + $b[$k]];
4545
}
4646

4747
$f = 0;
48-
for ($i = 0; $i <= 15; $i++) {
48+
for ($i = 0; $i <= 15; ++$i) {
4949
$f += $c[$i] * $c[$i];
5050
}
5151

@@ -64,7 +64,7 @@ public function testRun($secureRandom)
6464
$b = $this->getBitSequence($secureRandom, 20000);
6565

6666
$runs = array();
67-
for ($i = 1; $i <= 6; $i++) {
67+
for ($i = 1; $i <= 6; ++$i) {
6868
$runs[$i] = 0;
6969
}
7070

@@ -78,7 +78,7 @@ public function testRun($secureRandom)
7878

7979
$currentRun = 0;
8080
$lastBit = null;
81-
for ($i = 0; $i < 20000; $i++) {
81+
for ($i = 0; $i < 20000; ++$i) {
8282
if ($lastBit === $b[$i]) {
8383
++$currentRun;
8484
} else {
@@ -113,7 +113,7 @@ public function testLongRun($secureRandom)
113113

114114
$longestRun = $currentRun = 0;
115115
$lastBit = null;
116-
for ($i = 0; $i < 20000; $i++) {
116+
for ($i = 0; $i < 20000; ++$i) {
117117
if ($lastBit === $b[$i]) {
118118
++$currentRun;
119119
} else {
@@ -142,7 +142,7 @@ public function testSerialCorrelation($secureRandom)
142142
$b = $this->getBitSequence($secureRandom, 20000);
143143

144144
$Z = 0;
145-
for ($i = 0; $i < 5000; $i++) {
145+
for ($i = 0; $i < 5000; ++$i) {
146146
$Z += $b[$i] === $b[$i + $shift] ? 1 : 0;
147147
}
148148

Tests/Validator/Constraints/LegacyUserPasswordValidatorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
* @author Bernhard Schussek <bschussek@gmail.com>
1919
* @group legacy
2020
*/
21-
class LegacyUserPasswordValidatorApiTest extends UserPasswordValidatorTest
21+
class LegacyUserPasswordValidatorTest extends UserPasswordValidatorTest
2222
{
2323
protected function getApiVersion()
2424
{

Util/StringUtils.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public static function equals($knownString, $userInput)
6060

6161
$result = 0;
6262

63-
for ($i = 0; $i < $knownLen; $i++) {
63+
for ($i = 0; $i < $knownLen; ++$i) {
6464
$result |= (ord($knownString[$i]) ^ ord($userInput[$i]));
6565
}
6666

0 commit comments

Comments
 (0)