/** * Replace strange \000 character * * {@inheritdoc} */ public function decrypt($string, $key = null) { $password = parent::decrypt($string, $key); /** * Unknown bug in PhpStorm * Only PHPStorm adds \0 to the tail of password * Perhaps PHP versions conflict */ return rtrim($password, ""); }
/** * Encrypt password * * @param string $password * @return string */ protected function encrypt($password) { $crypter = new Crypter(); return $crypter->encrypt($password); }