<commit_before><?php

namespace Sifoni;

use Silex\Provider\MonologServiceProvider;
use Silex\Provider\TwigServiceProvider;
use Silex\Provider\ServiceControllerServiceProvider;
use Silex\Provider\TranslationServiceProvider;
use Silex\Provider\HttpFragmentServiceProvider;
use Silex\Provider\WebProfilerServiceProvider;
use Silex\Provider\LocaleServiceProvider;
use Silex\Provider\AssetServiceProvider;
use Silex\Provider\CsrfServiceProvider;
use Sifoni\Provider\CapsuleServiceProvider;
use Sifoni\Provider\SessionServiceProvider;
use Sifoni\Provider\HttpCacheServiceProvider;
use Monolog\Logger;
use Twig_SimpleFunction;
use Twig_Environment;

class Engine
{
    private static $instance = null;
    private $app = null;

    protected function __construct()
    {
        // Constructor of Engine
    }

    private function __clone()
    {
        // Prevent clone instance
    }

    private function __wakeup()
    {
        // Prevent unserialize instance
    }

    /**
     * @return Sifoni\Engine
     */
    public static function getInstance()
    {
        if (static::$instance === null) {
            static::$instance = new static();
        }

        return static::$instance;
    }

    /**
     * @return Sifoni\Application
     */
    public function getApp()
    {
        return $this->app;
    }

    /**
     * @param array $values Values of DI Application
     *
     * @return Sifoni\Engine
     */
    public function init(array $values = [])
    {
        if ($this->app) {
            return false;
        }

        $this->app = new Application($values);

        return $this;
    }

    /**
     * @param array $new_options
     *
     * @return Sifoni\Engine<commit_msg>Allow to clear Engine instance<commit_after><?php

namespace Sifoni;

use Silex\Provider\MonologServiceProvider;
use Silex\Provider\TwigServiceProvider;
use Silex\Provider\ServiceControllerServiceProvider;
use Silex\Provider\TranslationServiceProvider;
use Silex\Provider\HttpFragmentServiceProvider;
use Silex\Provider\WebProfilerServiceProvider;
use Silex\Provider\LocaleServiceProvider;
use Silex\Provider\AssetServiceProvider;
use Silex\Provider\CsrfServiceProvider;
use Sifoni\Provider\CapsuleServiceProvider;
use Sifoni\Provider\SessionServiceProvider;
use Sifoni\Provider\HttpCacheServiceProvider;
use Monolog\Logger;
use Twig_SimpleFunction;
use Twig_Environment;

class Engine
{
    private static $instance = null;
    private $app = null;

    protected function __construct()
    {
        // Constructor of Engine
    }

    private function __clone()
    {
        // Prevent clone instance
    }

    private function __wakeup()
    {
        // Prevent unserialize instance
    }

    /**
     * @return Sifoni\Engine
     */
    public static function getInstance()
    {
        if (static::$instance === null) {
            static::$instance = new static();
        }

        return static::$instance;
    }
    
    /**
     * @return void
     */
    public static function clearInstance()
    {
        static::$instance = null;
    }

    /**
     * @return Sifoni\Application
     */
    public function getApp()
    {
        return $this->app;
    }

    /**
     * @param array $values Values of DI Application
     *
     * @return Sifoni\Engine
     */
    public function init(array $values = [])
    {
        if ($this->app) {
            return false;
        }

        $this->app = new Application($values);

        return $this;
    }

    /**
     * @param array $new_options
     *
     * @return Sifoni\Engine
{'fraction_non_alphanumeric': 0.09907120743034056, 'fraction_numerical': 0.0, 'mean_word_length': 2.554, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '315626', 'n_tokens_mistral': 1035, 'n_tokens_neox': 1019, 'n_words': 227}