<commit_before><?php

namespace Da\OAuthClientBundle\Model;

use Symfony\Component\Security\Core\User\AdvancedUserInterface;
use FOS\UserBundle\Model\User as BaseUser;
use Doctrine\ORM\Mapping as ORM;
use HWI\Bundle\OAuthBundle\OAuth\Response\UserResponseInterface;
use Da\OAuthClientBundle\Security\Core\User\OAuthUserInterface;

/**
 * MemoryUser is the user implementation used by the memory user provider.
 *
 * @author <NAME> <<EMAIL>>
 */
class MemoryUser implements AdvancedUserInterface, OAuthUserInterface
{
    protected $username = '';
    protected $email = '';
    protected $password = '';
    protected $enabled = true;
    protected $accountNonExpired = true;
    protected $credentialsNonExpired = true;
    protected $accountNonLocked = true;
    protected $roles = array();
    protected $raw = array();

    /**
     * {@inheritDoc}
     */
    public function setFromResponse(UserResponseInterface $response)
    {
        $this->username = $response->getNickname();
		$this->email = $response->getEmail();
        $this->roles = json_decode($response->getRoles(), true);
        $this->raw = json_decode($response->getRaw(), true);
    }

    /**
     * {@inheritdoc}
     */
    public function getRoles()
    {
        return $this->roles;
    }

    /**
     * {@inheritdoc}
     */
    public function getPassword()
    {
        return $this->password;
    }

    /**
     * {@inheritdoc}
     */
    public function getSalt()
    {<commit_msg>Handle null value for roles and raw<commit_after><?php

namespace Da\OAuthClientBundle\Model;

use Symfony\Component\Security\Core\User\AdvancedUserInterface;
use FOS\UserBundle\Model\User as BaseUser;
use Doctrine\ORM\Mapping as ORM;
use HWI\Bundle\OAuthBundle\OAuth\Response\UserResponseInterface;
use Da\OAuthClientBundle\Security\Core\User\OAuthUserInterface;

/**
 * MemoryUser is the user implementation used by the memory user provider.
 *
 * @author <NAME> <<EMAIL>>
 */
class MemoryUser implements AdvancedUserInterface, OAuthUserInterface
{
    protected $username = '';
    protected $email = '';
    protected $password = '';
    protected $enabled = true;
    protected $accountNonExpired = true;
    protected $credentialsNonExpired = true;
    protected $accountNonLocked = true;
    protected $roles = array();
    protected $raw = array();

    /**
     * {@inheritDoc}
     */
    public function setFromResponse(UserResponseInterface $response)
    {
        $this->username = $response->getNickname();
		$this->email = $response->getEmail();
        $this->roles = json_decode($response->getRoles(), true);
        if (!is_array($this->roles)) {
            $this->roles = array();
        }
        $this->raw = json_decode($response->getRaw(), true);
        if (!is_array($this->raw)) {
            $this->raw = array();
        }
    }

    /**
     * {@inheritdoc}
     */
    public function getRoles()
    {
        return $this->roles;
    }

    /**
     * {@inheritdoc}
     */
    public function getPassword()
    {
        return $this->password;
    }

    /**
     * {@inheritdoc}
     */
    public function getSalt()
    {
{'fraction_non_alphanumeric': 0.13482428115015974, 'fraction_numerical': 0.0, 'mean_word_length': 2.879801734820322, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 33, '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': '3472101', 'n_tokens_mistral': 923, 'n_tokens_neox': 910, 'n_words': 196}