<commit_before><?php

namespace DI\Bridge\Symfony;

use DI\Container;
use DI\ContainerInterface;
use DI\NotFoundException;
use Symfony\Component\DependencyInjection\Container as SymfonyContainer;
use Symfony\Component\DependencyInjection\ContainerInterface as SymfonyContainerInterface;
use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;

/**
 * Replacement for the Symfony service container.
 *
 * @author <NAME> <<EMAIL>>
 */
class SymfonyContainerBridge extends SymfonyContainer implements SymfonyContainerInterface, ContainerInterface
{
    /**
     * @var Container
     */
    private $fallbackContainer;

    /**
     * @param Container $container
     */
    public function setPHPDIContainer(Container $container)
    {
        $this->fallbackContainer = $container;
    }

    /**
     * @return Container
     */
    public function getPHPDIContainer()
    {
        return $this->fallbackContainer;
    }

    public function has($id)
    {
        if (parent::has($id)) {
            return true;
        }

        if (! $this->fallbackContainer) {
            return false;
        }

        return $this->fallbackContainer->has($id);
    }

    public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE)
    {
        if (parent::has($id)) {
            return parent::get($id, $invalidBehavior);
        }

        if (! $this->fallbackContainer) {<commit_msg>Used only ContainerInterface, not Container<commit_after><?php
/**
 * PHP-DI
 *
 * @link      http://php-di.org/
 * @copyright <NAME> (http://mnapoli.fr/)
 * @license   http://www.opensource.org/licenses/mit-license.php MIT (see the LICENSE file)
 */

namespace DI\Bridge\Symfony;

use DI\ContainerInterface;
use DI\NotFoundException;
use Symfony\Component\DependencyInjection\Container as SymfonyContainer;
use Symfony\Component\DependencyInjection\ContainerInterface as SymfonyContainerInterface;
use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;

/**
 * Replacement for the Symfony service container.
 * 
 * This container extends Symfony's container with a fallback container when an entry is not found.
 * That way, we can put PHP-DI's container as a fallback to Symfony's.
 *
 * @author <NAME> <<EMAIL>>
 */
class SymfonyContainerBridge extends SymfonyContainer implements SymfonyContainerInterface, ContainerInterface
{
    /**
     * @var ContainerInterface|null
     */
    private $fallbackContainer;

    /**
     * @param ContainerInterface $container
     */
    public function setFallbackContainer(ContainerInterface $container)
    {
        $this->fallbackContainer = $container;
    }

    /**
     * @return ContainerInterface
     */
    public function getFallbackContainer()
    {
        return $this->fallbackContainer;
    }

    public function has($id)
    {
        if (parent::has($id)) {
            return true;
        }

        if (! $this->fallbackContainer) {
            return false;
        }

        return $this->fallbackContainer->has($id);
    }

    public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE)
    {
        if (parent::has($id)) {
            return parent::get($id, $invalidBehavior);
        }

        if (! $this->fallbackContainer) {
{'fraction_non_alphanumeric': 0.10921293471629043, 'fraction_numerical': 0.0, 'mean_word_length': 3.0183823529411766, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 22, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, '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': '2133895', 'n_tokens_mistral': 900, 'n_tokens_neox': 881, 'n_words': 202}