<commit_before><?php

/**
 * Widget Framework
 *
 * @copyright   Copyright (c) 2008-2012 <NAME>
 * @license     http://www.opensource.org/licenses/apache2.0.php Apache License
 */

namespace Widget;

/**
 * NewInstance
 *
 * @package     Widget
 * @author      <NAME> <<EMAIL>>
 */
class NewInstance extends WidgetProvider
{
    /**
     * Instance a widget with the specify configuration name
     * 
     * @param string $name The name of widget
     * @param string $configName The name of configuration
     * @return \Widget\WidgetProvider
     */
    public function __invoke($name, $configName)
    {
        $name .= '.' . uniqid();
        $this->widget->config($name, $this->config($configName));
        return $this->widget->get($name);
    }

    /**
     * {@inheritdoc}
     */
    public function __get($name)
    {
        return $this->widget->get($name . '.' . uniqid());
    }

    /**
     * {@inheritdoc}
     */
    public function __call($name, $args)
    {
        return $this->widget->invoke($name . '.' . uniqid(), $args);
    }
}<commit_msg>added method annotation for newInstance widget<commit_after><?php

/**
 * Widget Framework
 *
 * @copyright   Copyright (c) 2008-2012 <NAME>
 * @license     http://www.opensource.org/licenses/apache2.0.php Apache License
 */

namespace Widget;

/**
 * NewInstance
 *
 * @package     Widget
 * @author      <NAME> <<EMAIL>>
 * @method array config(string $name) Returns the config by specified name
 */
class NewInstance extends WidgetProvider
{
    /**
     * Instance a widget with the specify configuration name
     * 
     * @param string $name The name of widget
     * @param string $configName The name of configuration
     * @return \Widget\WidgetProvider
     */
    public function __invoke($name, $configName)
    {
        $name .= '.' . uniqid();
        $this->widget->config($name, $this->config($configName));
        return $this->widget->get($name);
    }

    /**
     * {@inheritdoc}
     */
    public function __get($name)
    {
        return $this->widget->get($name . '.' . uniqid());
    }

    /**
     * {@inheritdoc}
     */
    public function __call($name, $args)
    {
        return $this->widget->invoke($name . '.' . uniqid(), $args);
    }
}
{'fraction_non_alphanumeric': 0.1561387900355872, 'fraction_numerical': 0.008896797153024912, 'mean_word_length': 2.3870481927710845, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '1044823', 'n_tokens_mistral': 689, 'n_tokens_neox': 674, 'n_words': 163}