<commit_before><?php

use \Pimple;
use \InvalidArgumentException;
use \ReflectionClass;

abstract class Container
{
    /** @var Pimple */
    private static $pimple;

    /**
     * Set the Pimple instance
     *
     * @param Pimple $pimple
     */
    public static function setPimple(Pimple $pimple)
    {
        static::$pimple = $pimple;
    }

    /**
     * Get service from the container
     *
     * @param string $service    Service name, "\Namespace\Component\UserIdentity"
     * @param array  $parameters Parameters service may require for constructor
     * @return mixed
     */
    public static function get($service, array $parameters = array())
    {
        self::$pimple->offsetSet('parameters', $parameters);

        $finalServiceName = "{$service}-isFinal";

        // Not defined
        if (!self::$pimple->offsetExists($finalServiceName)) {
            self::createNewService($service, $parameters);
        }

        // Do this again for services called with new set of parameters
        if (!empty($parameters) && !self::$pimple->offsetExists($finalServiceName)) {
            self::createNewService($service, $parameters);
        }

        return self::$pimple[$service];
    }

    /**
     * @param string $serviceName Service name - fully qualified
     * @param mixed  $service     Value to return
     * @param bool   $final       Flag to override service when parameters are sent. This is useful when injecting a
     *                            mocked object from our tests and not allowing our code to override the mock with a<commit_msg>Changing variable<commit_after><?php

use \Pimple;
use \InvalidArgumentException;
use \ReflectionClass;

abstract class Container
{
    /** @var Pimple */
    private static $pimple;

    /**
     * Set the Pimple instance
     *
     * @param Pimple $pimple
     */
    public static function setPimple(Pimple $pimple)
    {
        static::$pimple = $pimple;
    }

    /**
     * Get service from the container
     *
     * @param string $service    Service name, "\Namespace\Component\UserIdentity"
     * @param array  $parameters Parameters service may require for constructor
     * @return mixed
     */
    public static function get($service, array $parameters = array())
    {
        self::$pimple->offsetSet('parameters', $parameters);

        $finalServiceName = "{$service}-isFinal";

        // Not defined
        if (!self::$pimple->offsetExists($service)) {
            self::createNewService($service, $parameters);
        }

        // Do this again for services called with new set of parameters
        if (!empty($parameters) && !self::$pimple->offsetExists($finalServiceName)) {
            self::createNewService($service, $parameters);
        }

        return self::$pimple[$service];
    }

    /**
     * @param string $serviceName Service name - fully qualified
     * @param mixed  $service     Value to return
     * @param bool   $final       Flag to override service when parameters are sent. This is useful when injecting a
     *                            mocked object from our tests and not allowing our code to override the mock with a
{'fraction_non_alphanumeric': 0.10552922590837283, 'fraction_numerical': 0.0, 'mean_word_length': 2.4338394793926246, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4252314', 'n_tokens_mistral': 841, 'n_tokens_neox': 804, 'n_words': 264}