<commit_before><?php

/*
 * This file is apart of the DiscordPHP project.
 *
 * Copyright (c) 2016-2020 <NAME> <<EMAIL>>
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the LICENSE.md file.
 */

namespace Discord\Factory;

use Discord\Discord;
use Discord\Http\Http;

/**
 * Exposes an interface to build part objects without the other requirements.
 */
class Factory
{
    /**
     * The Discord client.
     *
     * @var Discord Client.
     */
    protected $discord;

    /**
     * The HTTP client.
     *
     * @var Http Client.
     */
    protected $http;

    /**
     * The cache.
     *
     * @var CacheWrapper Cache.
     */
    protected $cache;
    /**
     * Constructs a factory.
     *
     * @param Discord      $discord The Discord client.
     * @param Http         $http    The HTTP client.
     */
    public function __construct(Discord $discord, Http $http)
    {
        $this->discord = $discord;
        $this->http = $http;
    }

    /**
     * Creates an object.
     *
     * @param string $class   The class to build.
     * @param array  $data    Data to create the object.
     * @param bool   $created Whether the object is created (if part).
     *
     * @return mixed The object.
     */
    public function create($class, $data = [], $created = false)
    {
        if (! is_array($data)) {
            $data = (array) $data;<commit_msg>Removing unused variable<commit_after><?php

/*
 * This file is apart of the DiscordPHP project.
 *
 * Copyright (c) 2016-2020 <NAME> <<EMAIL>>
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the LICENSE.md file.
 */

namespace Discord\Factory;

use Discord\Discord;
use Discord\Http\Http;

/**
 * Exposes an interface to build part objects without the other requirements.
 */
class Factory
{
    /**
     * The Discord client.
     *
     * @var Discord Client.
     */
    protected $discord;

    /**
     * The HTTP client.
     *
     * @var Http Client.
     */
    protected $http;

    /**
     * Constructs a factory.
     *
     * @param Discord      $discord The Discord client.
     * @param Http         $http    The HTTP client.
     */
    public function __construct(Discord $discord, Http $http)
    {
        $this->discord = $discord;
        $this->http = $http;
    }

    /**
     * Creates an object.
     *
     * @param string $class   The class to build.
     * @param array  $data    Data to create the object.
     * @param bool   $created Whether the object is created (if part).
     *
     * @return mixed The object.
     */
    public function create($class, $data = [], $created = false)
    {
        if (! is_array($data)) {
            $data = (array) $data;
{'fraction_non_alphanumeric': 0.11580086580086581, 'fraction_numerical': 0.005772005772005772, 'mean_word_length': 1.9657754010695188, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, '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': '5877132', 'n_tokens_mistral': 852, 'n_tokens_neox': 830, 'n_words': 282}