<commit_before><?php

namespace Timiki\Bundle\RpcServerBundle\Serializer;

use Symfony\Component\Security\Core\Security;
use Symfony\Component\Security\Core\User\UserInterface;
use Symfony\Component\Serializer\Serializer;

class RoleSerializer extends BaseSerializer
{
    /**
     * @var null|UserInterface
     */
    protected $user;

    /**
     * @param \Symfony\Component\Serializer\Serializer  $serializer
     * @param \Symfony\Component\Security\Core\Security $security
     */
    public function __construct(Serializer $serializer, Security $security)
    {
        parent::__construct($serializer);

        $this->user = $security->getUser();
    }

    /**
     * Serialize data.
     *
     * @param mixed $data
     *
     * @return array
     */<commit_msg>fix RoleSerializer<commit_after><?php

namespace Timiki\Bundle\RpcServerBundle\Serializer;

use Symfony\Component\Security\Core\Security;
use Symfony\Component\Security\Core\User\UserInterface;
use Symfony\Component\Serializer\Serializer;

class RoleSerializer extends BaseSerializer
{
    /**
     * @var null|UserInterface
     */
    protected $user;

    /**
     * @param \Symfony\Component\Serializer\Serializer       $serializer
     * @param null|\Symfony\Component\Security\Core\Security $security
     */
    public function __construct(Serializer $serializer, Security $security = null)
    {
        parent::__construct($serializer);

        if ($security) {
            $this->user = $security->getUser();
        }
    }

    /**
     * Serialize data.
     *
     * @param mixed $data
     *
     * @return array
     */
{'fraction_non_alphanumeric': 0.11855990068280571, 'fraction_numerical': 0.0, 'mean_word_length': 2.810874704491726, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '4312291', 'n_tokens_mistral': 454, 'n_tokens_neox': 449, 'n_words': 82}