<commit_before><?php
/**
 * 
 * This file is part of Aura for PHP.
 * 
 * @package Aura.Di
 * 
 * @license http://opensource.org/licenses/bsd-license.php BSD
 * 
 */
namespace Aura\Di;

use Aura\Di\Container;

/**
 * 
 * Wraps a callable specifically for the purpose of lazy-loading an object.
 * 
 * @package Aura.Di
 * 
 */
class LazyNew implements LazyInterface
{
    /**
     * 
     * The container.
     * 
     * @var Container
     * 
     */
    protected $container;

    /**
     * 
     * The class to instantiate.
     * 
     * @var string
     * 
     */
    protected $class;
    
    /**
     * 
     * Params for the instantiation.
     * 
     * @var array
     * 
     */
    protected $params = array();
    
    /**
     * 
     * Setters for the instantiation.
     * 
     * @var array
     * 
     */
    protected $setters = array();
    
    /**
     * 
     * Constructor.
     * 
     * @param Factory $factory The object factory.
     * 
     * @param string $class The class to instantiate.
     * 
     * @param array $params Params for the instantiation.
     * 
     * @param array $setters Setters for the instantiation.
     * 
     */
    public function __construct(
        Factory $factory,
        $class,
        array $params,
        array $setters
    ) {
        $this->factory = $factory;
        $this->class = $class;
        $this->params = $params;
        $this->setters = $setters;
    }

    /**
     * 
     * Invokes the closure to create the instance.
     * 
     * @return object The object created by the closure.
     * 
     */
    public function __invoke()
    {
        return $this->factory->newInstance(
            $this->class,
            $this->params,
            $this->setters
        );
    }
}<commit_msg>reduce duplication for scrutinizer<commit_after><?php
/**
 * 
 * This file is part of Aura for PHP.
 * 
 * @package Aura.Di
 * 
 * @license http://opensource.org/licenses/bsd-license.php BSD
 * 
 */
namespace Aura\Di;

use Aura\Di\Container;

/**
 * 
 * Wraps a callable specifically for the purpose of lazy-loading an object.
 * 
 * @package Aura.Di
 * 
 */
class LazyNew extends InstanceFactory implements LazyInterface
{
}
{'fraction_non_alphanumeric': 0.11876699909338169, 'fraction_numerical': 0.0, 'mean_word_length': 1.7079754601226993, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 12, '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': '5063055', 'n_tokens_mistral': 715, 'n_tokens_neox': 673, 'n_words': 176}