Skip to content

Commit 94ae9a7

Browse files
[Security] deprecate BCryptPasswordEncoder in favor of NativePasswordEncoder
1 parent 54ca022 commit 94ae9a7

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

Encoder/BCryptPasswordEncoder.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,15 @@
1111

1212
namespace Symfony\Component\Security\Core\Encoder;
1313

14+
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.3, use "%s" instead.', BCryptPasswordEncoder::class, NativePasswordEncoder::class), E_USER_DEPRECATED);
15+
1416
use Symfony\Component\Security\Core\Exception\BadCredentialsException;
1517

1618
/**
1719
* @author Elnur Abdurrakhimov <[email protected]>
1820
* @author Terje Bråten <[email protected]>
21+
*
22+
* @deprecated since Symfony 4.3, use NativePasswordEncoder instead
1923
*/
2024
class BCryptPasswordEncoder extends BasePasswordEncoder implements SelfSaltingEncoderInterface
2125
{

Encoder/EncoderFactory.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ private function getEncoderConfigFromAlgorithm($config)
106106
],
107107
];
108108

109+
/* @deprecated since Symfony 4.3 */
109110
case 'bcrypt':
110111
return [
111112
'class' => BCryptPasswordEncoder::class,

Tests/Encoder/BCryptPasswordEncoderTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
/**
1818
* @author Elnur Abdurrakhimov <[email protected]>
19+
*
20+
* @group legacy
1921
*/
2022
class BCryptPasswordEncoderTest extends TestCase
2123
{

0 commit comments

Comments
 (0)