<commit_before><?php

namespace Ms\OauthBundle\Component\Authentication;

use Symfony\Component\Security\Core\Util\SecureRandom;
use Symfony\Component\Security\Core\Encoder\Pbkdf2PasswordEncoder;

/**
 * Description of MsOauthPasswordGenerator
 *
 * @author user
 */
class MsOauthPasswordGenerator implements PasswordGeneratorInterface {
    
    /**
     *
     * @var SecureRandom 
     */
    private $rng;
    
    /**
     *
     * @var Pbkdf2PasswordEncoder 
     */
    private $encoder;
    
    /**
     * 
     */
    public function __construct() {
        $this->rng = new SecureRandom();
        $this->encoder = new Pbkdf2PasswordEncoder('sha512', true, 2000, 20);
    }

    /**
     * @inheritdoc
     */
    public function createPassword($salt) {
        $random = $this->rng->nextBytes(20);
        
        return $this->encoder->encodePassword($random, $salt);
    }

    /**
     * @inheritdoc
     */
    public function createSalt() {
        return $this->rng->nextBytes(10);
    }

}<commit_msg>Change the type of the MsOauthPasswordGenerator "encoder" member to PasswordEncoderInterface.<commit_after><?php

namespace Ms\OauthBundle\Component\Authentication;

use Symfony\Component\Security\Core\Util\SecureRandom;
use Symfony\Component\Security\Core\Encoder\PasswordEncoderInterface;
use Symfony\Component\Security\Core\Encoder\Pbkdf2PasswordEncoder;

/**
 * Description of MsOauthPasswordGenerator
 *
 * @author user
 */
class MsOauthPasswordGenerator implements PasswordGeneratorInterface {
    
    /**
     *
     * @var SecureRandom 
     */
    private $rng;
    
    /**
     *
     * @var PasswordEncoderInterface 
     */
    private $encoder;
    
    /**
     * 
     */
    public function __construct() {
        $this->rng = new SecureRandom();
        $this->encoder = new Pbkdf2PasswordEncoder('sha512', true, 2000, 20);
    }

    /**
     * @inheritdoc
     */
    public function createPassword($salt) {
        $random = $this->rng->nextBytes(20);
        
        return $this->encoder->encodePassword($random, $salt);
    }

    /**
     * @inheritdoc
     */
    public function createSalt() {
        return base64_encode($this->rng->nextBytes(10));
    }

}
{'fraction_non_alphanumeric': 0.1253393665158371, 'fraction_numerical': 0.01493212669683258, 'mean_word_length': 2.520700636942675, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5630495', 'n_tokens_mistral': 692, 'n_tokens_neox': 642, 'n_words': 113}