diff options
author | Fabien Potencier <fabien.potencier@gmail.com> | 2015-05-15 15:28:34 +0200 |
---|---|---|
committer | Fabien Potencier <fabien.potencier@gmail.com> | 2015-05-15 15:28:34 +0200 |
commit | c29b2f6d4618d6366d6e5fb3770169c7e1773bf3 (patch) | |
tree | 0590e954cc2ecc984a70105855fb319701239122 /Core/Encoder | |
parent | ffa3efde95d20fb8840f47c26de3bbc6425e1277 (diff) | |
parent | 9278dfa5dd6dfbcda01e947459b34fdd0e2e68bb (diff) | |
download | symfony-security-c29b2f6d4618d6366d6e5fb3770169c7e1773bf3.zip symfony-security-c29b2f6d4618d6366d6e5fb3770169c7e1773bf3.tar.gz symfony-security-c29b2f6d4618d6366d6e5fb3770169c7e1773bf3.tar.bz2 |
minor #14121 CS: Pre incrementation/decrementation should be used if possible (gharlan)
This PR was merged into the 2.3 branch.
Discussion
----------
CS: Pre incrementation/decrementation should be used if possible
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
Fixes provided by new fixer: https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/1113
If this pr is merged I would change the level of the fixer to `symfony`.
Commits
-------
c5123d6 CS: Pre incrementation/decrementation should be used if possible
Diffstat (limited to 'Core/Encoder')
-rw-r--r-- | Core/Encoder/MessageDigestPasswordEncoder.php | 2 | ||||
-rw-r--r-- | Core/Encoder/Pbkdf2PasswordEncoder.php | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/Core/Encoder/MessageDigestPasswordEncoder.php b/Core/Encoder/MessageDigestPasswordEncoder.php index 03de228..1706fc8 100644 --- a/Core/Encoder/MessageDigestPasswordEncoder.php +++ b/Core/Encoder/MessageDigestPasswordEncoder.php @@ -55,7 +55,7 @@ class MessageDigestPasswordEncoder extends BasePasswordEncoder $digest = hash($this->algorithm, $salted, true); // "stretch" hash - for ($i = 1; $i < $this->iterations; $i++) { + for ($i = 1; $i < $this->iterations; ++$i) { $digest = hash($this->algorithm, $digest.$salted, true); } diff --git a/Core/Encoder/Pbkdf2PasswordEncoder.php b/Core/Encoder/Pbkdf2PasswordEncoder.php index dac1cad..6f24c4f 100644 --- a/Core/Encoder/Pbkdf2PasswordEncoder.php +++ b/Core/Encoder/Pbkdf2PasswordEncoder.php @@ -87,11 +87,11 @@ class Pbkdf2PasswordEncoder extends BasePasswordEncoder $blocks = ceil($length / strlen(hash($algorithm, null, true))); $digest = ''; - for ($i = 1; $i <= $blocks; $i++) { + for ($i = 1; $i <= $blocks; ++$i) { $ib = $block = hash_hmac($algorithm, $salt.pack('N', $i), $password, true); // Iterations - for ($j = 1; $j < $iterations; $j++) { + for ($j = 1; $j < $iterations; ++$j) { $ib ^= ($block = hash_hmac($algorithm, $block, $password, true)); } |