vendor/symfony/security-core/Encoder/NativePasswordEncoder.php line 16

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of the Symfony package.
  4.  *
  5.  * (c) Fabien Potencier <[email protected]>
  6.  *
  7.  * For the full copyright and license information, please view the LICENSE
  8.  * file that was distributed with this source code.
  9.  */
  10. namespace Symfony\Component\Security\Core\Encoder;
  11. use Symfony\Component\PasswordHasher\Hasher\NativePasswordHasher;
  12. trigger_deprecation('symfony/security-core''5.3''The "%s" class is deprecated, use "%s" instead.'NativePasswordEncoder::class, NativePasswordHasher::class);
  13. /**
  14.  * Hashes passwords using password_hash().
  15.  *
  16.  * @author Elnur Abdurrakhimov <[email protected]>
  17.  * @author Terje BrĂ¥ten <[email protected]>
  18.  * @author Nicolas Grekas <[email protected]>
  19.  *
  20.  * @deprecated since Symfony 5.3, use {@link NativePasswordHasher} instead
  21.  */
  22. final class NativePasswordEncoder implements PasswordEncoderInterfaceSelfSaltingEncoderInterface
  23. {
  24.     use LegacyEncoderTrait;
  25.     /**
  26.      * @param string|null $algo An algorithm supported by password_hash() or null to use the stronger available algorithm
  27.      */
  28.     public function __construct(?int $opsLimit null, ?int $memLimit null, ?int $cost null, ?string $algo null)
  29.     {
  30.         $this->hasher = new NativePasswordHasher($opsLimit$memLimit$cost$algo);
  31.     }
  32. }