當前位置: 首頁>>代碼示例>>PHP>>正文


PHP UserInterface::getPlainPassword方法代碼示例

本文整理匯總了PHP中Sylius\Component\User\Model\UserInterface::getPlainPassword方法的典型用法代碼示例。如果您正苦於以下問題:PHP UserInterface::getPlainPassword方法的具體用法?PHP UserInterface::getPlainPassword怎麽用?PHP UserInterface::getPlainPassword使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Sylius\Component\User\Model\UserInterface的用法示例。


在下文中一共展示了UserInterface::getPlainPassword方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: updatePassword

 /**
  * {@inheritDoc}
  */
 public function updatePassword(UserInterface $user)
 {
     if (0 !== strlen($password = $user->getPlainPassword())) {
         $user->setPassword($this->userPasswordEncoder->encode($user));
         $user->eraseCredentials();
     }
 }
開發者ID:nanyi,項目名稱:Sylius,代碼行數:10,代碼來源:PasswordUpdater.php

示例2: updatePassword

 /**
  * {@inheritDoc}
  */
 public function updatePassword(UserInterface $user)
 {
     if (0 !== strlen($password = $user->getPlainPassword())) {
         $encoder = $this->encoderFactory->getEncoder($user);
         $user->setPassword($encoder->encodePassword($password, $user->getSalt()));
         $user->eraseCredentials();
     }
 }
開發者ID:Strontium-90,項目名稱:Sylius,代碼行數:11,代碼來源:PasswordUpdater.php

示例3:

 function it_does_nothing_if_plain_password_is_empty(UserPasswordEncoderInterface $userPasswordEncoder, UserInterface $user)
 {
     $user->getPlainPassword()->willReturn('');
     $userPasswordEncoder->encode($user)->willReturn('topSecretEncodedPassword');
     $user->setPassword(Argument::any())->shouldNotBeCalled();
     $user->eraseCredentials()->shouldNotBeCalled();
     $this->updatePassword($user);
 }
開發者ID:TheMadeleine,項目名稱:Sylius,代碼行數:8,代碼來源:PasswordUpdaterSpec.php

示例4:

 function it_encodes_password(EncoderFactoryInterface $encoderFactory, PasswordEncoderInterface $passwordEncoder, UserInterface $user)
 {
     $user->getPlainPassword()->willReturn('topSecretPlainPassword');
     $user->getSalt()->willReturn('typicalSalt');
     $encoderFactory->getEncoder($user)->willReturn($passwordEncoder);
     $passwordEncoder->encodePassword('topSecretPlainPassword', 'typicalSalt')->willReturn('topSecretEncodedPassword');
     $this->encode($user)->shouldReturn('topSecretEncodedPassword');
 }
開發者ID:nanyi,項目名稱:Sylius,代碼行數:8,代碼來源:UserPasswordEncoderSpec.php

示例5: it_does_nothing_if_plain_password_is_empty

 public function it_does_nothing_if_plain_password_is_empty($encoderFactory, PasswordEncoderInterface $encoder, UserInterface $user)
 {
     $user->getPlainPassword()->willReturn('');
     $user->getSalt()->willReturn('typicalSalt');
     $encoderFactory->getEncoder($user)->shouldNotBeCalled();
     $encoder->encodePassword('', 'typicalSalt')->shouldNotBeCalled();
     $user->setPassword(Argument::any())->shouldNotBeCalled();
     $user->eraseCredentials()->shouldNotBeCalled();
     $this->updatePassword($user);
 }
開發者ID:Strontium-90,項目名稱:Sylius,代碼行數:10,代碼來源:PasswordUpdaterSpec.php

示例6: updateUserPassword

 /**
  * @param UserInterface $user
  */
 public function updateUserPassword(UserInterface $user)
 {
     if (null !== $user->getPlainPassword()) {
         $this->passwordUpdater->updatePassword($user);
     }
 }
開發者ID:Strontium-90,項目名稱:Sylius,代碼行數:9,代碼來源:PasswordUpdaterListener.php

示例7: encode

 /**
  * {@inheritdoc}
  *
  * @throws \LogicException when the algorithm is not supported
  */
 public function encode(UserInterface $user)
 {
     return $this->encodePassword($user->getPlainPassword(), $user->getSalt());
 }
開發者ID:kongqingfu,項目名稱:Sylius,代碼行數:9,代碼來源:UserPbkdf2PasswordEncoder.php

示例8:

 function it_encodes_password(UserInterface $user)
 {
     $user->getPlainPassword()->willReturn('myPassword');
     $user->getSalt()->willReturn('typicalSalt');
     $this->encode($user)->shouldReturn('G1DuArwJiu+4Ctk9p2965gC3SXjGcom6gNhmV0OGUm79Kb9Anm5GWg==');
 }
開發者ID:nanyi,項目名稱:Sylius,代碼行數:6,代碼來源:UserPbkdf2PasswordEncoderSpec.php


注:本文中的Sylius\Component\User\Model\UserInterface::getPlainPassword方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。