<commit_before><?php

namespace League\FactoryMuffin\Kind;

use InvalidArgumentException;
use League\FactoryMuffin\Kind;

/**
 * Class Generic.
 *
 * @package League\FactoryMuffin\Kind
 * @author  Zizaco <<EMAIL>>
 * @author  <NAME> <<EMAIL>>
 * @author  <NAME> <<EMAIL>>
 * @license <https://github.com/thephpleague/factory-muffin/blob/master/LICENSE> MIT
 */
class Generic extends Kind
{
    /**
     * Generate, and return the attribute.
     *
     * We attempt to use Faker for any string passed in.
     * If a Faker property does not exist, we'll return the original string.
     *
     * @return mixed
     */
    public function generate()
    {
        // Only try and use Faker when there are no spaces in the string
        if (!is_string($this->getKind()) or strpos($this->getKind(), ' ') !== false) {
            return $this->getKind();
        }

        // If it fails to call it, it must not be a real thing
        try {
            return call_user_func_array(array($this->faker, $this->kind), $this->getOptions());
        } catch (InvalidArgumentException $e) {

        }

        // Just return the literal string
        return $this->getKind();
    }<commit_msg>Use call_user_func_array so we can pass options to faker<commit_after><?php

namespace League\FactoryMuffin\Kind;

use InvalidArgumentException;
use League\FactoryMuffin\Kind;

/**
 * Class Generic.
 *
 * @package League\FactoryMuffin\Kind
 * @author  Zizaco <<EMAIL>>
 * @author  <NAME> <<EMAIL>>
 * @author  <NAME> <<EMAIL>>
 * @license <https://github.com/thephpleague/factory-muffin/blob/master/LICENSE> MIT
 */
class Generic extends Kind
{
    /**
     * Generate, and return the attribute.
     *
     * We attempt to use Faker for any string passed in.
     * If a Faker property does not exist, we'll return the original string.
     *
     * @return mixed
     */
    public function generate()
    {
        // Only try and use Faker when there are no spaces in the string
        if (!is_string($this->getKind()) or strpos($this->getKind(), ' ') !== false) {
            return $this->getKind();
        }

        // If it fails to call it, it must not be a real thing
        try {
            return call_user_func_array(array($this->faker, $this->getKind()), $this->getOptions());
        } catch (InvalidArgumentException $e) {

        }

        // Just return the literal string
        return $this->getKind();
    }
{'fraction_non_alphanumeric': 0.12623762376237624, 'fraction_numerical': 0.0, 'mean_word_length': 2.54014598540146, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 35, 'https://': 2, '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': '6018659', 'n_tokens_mistral': 721, 'n_tokens_neox': 709, 'n_words': 222}