<commit_before><?php

namespace tgbot\Api\Types;

use tgbot\Api\BaseType;
use tgbot\Api\InvalidArgumentException;
use tgbot\Api\TypeInterface;


/**
 * Class User
 * This object represents a Telegram user or bot.
 *
 * @package tgbot\Api\Types
 */
class User extends BaseType implements TypeInterface
{
    /**
     * Unique identifier for this user or bot
     *
     * @var int
     */
    protected $id;

    /**
     * User‘s or bot’s first name
     *
     * @var string
     */
    protected $first_name;

    /**
     * Optional. User‘s or bot’s last name
     *
     * @var string
     */
    protected $last_name;

    /**
     * Optional. User‘s or bot’s username
     *
     * @var string
     */
    protected $username;

    /**
     * @return string
     */
    public function getFirstName()
    {
        return $this->first_name;
    }

    /**
     * @param string $first_name
     */
    public function setFirstName($first_name)
    {
        $this->first_name = $first_name;
    }

    /**
     * @return int
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * @param int $id
     */
    public function setId($id)
    {
        if (is_numeric($id)) {
            $this->id = $id;
        } else {
            throw new InvalidArgumentException();
        }
    }

    /**
     * @return string
     */
    public function getLastName()
    {
        return $this->last_name;
    }

    /**
     * @param string $last_name
     */
    public function setLastName($last_name)
    {
        $this->last_name = $last_name;
    }

    /**
     * @return string
     */
    public function getUsername()
    {
        return $this->username;
    }

    /**
     * @param string $username
     */
    public function setUsername($username)
    {
        $this->username = $username;
    }

    public static function fromResponse($data)
    {
        $instance = new User();

        if (!isset($data['id'], $data['first_name'])) {
            throw new InvalidArgumentException();
        }
        $instance->setId($data['id']);
        $instance->setFirstName($data['first_name']);

        if (isset($data['last_name'])) {
            $instance->setLastName($data['last_name']);
        }
        if (isset($data['last_name'])) {
            $instance->setUsername($data['username']);
        }

        return $instance;
    }
}<commit_msg>bugfix<commit_after><?php

namespace tgbot\Api\Types;

use tgbot\Api\BaseType;
use tgbot\Api\InvalidArgumentException;
use tgbot\Api\TypeInterface;


/**
 * Class User
 * This object represents a Telegram user or bot.
 *
 * @package tgbot\Api\Types
 */
class User extends BaseType implements TypeInterface
{
    /**
     * Unique identifier for this user or bot
     *
     * @var int
     */
    protected $id;

    /**
     * User‘s or bot’s first name
     *
     * @var string
     */
    protected $first_name;

    /**
     * Optional. User‘s or bot’s last name
     *
     * @var string
     */
    protected $last_name;

    /**
     * Optional. User‘s or bot’s username
     *
     * @var string
     */
    protected $username;

    /**
     * @return string
     */
    public function getFirstName()
    {
        return $this->first_name;
    }

    /**
     * @param string $first_name
     */
    public function setFirstName($first_name)
    {
        $this->first_name = $first_name;
    }

    /**
     * @return int
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * @param int $id
     */
    public function setId($id)
    {
        if (is_numeric($id)) {
            $this->id = $id;
        } else {
            throw new InvalidArgumentException();
        }
    }

    /**
     * @return string
     */
    public function getLastName()
    {
        return $this->last_name;
    }

    /**
     * @param string $last_name
     */
    public function setLastName($last_name)
    {
        $this->last_name = $last_name;
    }

    /**
     * @return string
     */
    public function getUsername()
    {
        return $this->username;
    }

    /**
     * @param string $username
     */
    public function setUsername($username)
    {
        $this->username = $username;
    }

    public static function fromResponse($data)
    {
        $instance = new self();

        if (!isset($data['id'], $data['first_name'])) {
            throw new InvalidArgumentException();
        }
        $instance->setId($data['id']);
        $instance->setFirstName($data['first_name']);

        if (isset($data['last_name'])) {
            $instance->setLastName($data['last_name']);
        }
        if (isset($data['username'])) {
            $instance->setUsername($data['username']);
        }

        return $instance;
    }
}
{'fraction_non_alphanumeric': 0.13826232247284878, 'fraction_numerical': 0.0, 'mean_word_length': 1.7634160415464513, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 27, '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': '7347431', 'n_tokens_mistral': 1480, 'n_tokens_neox': 1440, 'n_words': 310}