<commit_before><?php
/**
 * @package    Fuel\Foundation
 * @version    2.0
 * @author     Fuel Development Team
 * @license    MIT License
 * @copyright  2010 - 2016 Fuel Development Team
 * @link       http://fuelphp.com
 */

declare(strict_types=1);

namespace Fuel\Foundation;

use Fuel\Dependency\Container;
use League\Container\ContainerInterface;

class Application
{
	/**
	 * @var ContainerInterface
	 */
	protected $dependencyContainer;

	public static function init(array $config) : Application
	{
		return new static($config);
	}

	public function __construct(array $config, ContainerInterface $dependencyContainer = null)
	{
		$this->setDependencyContainer($dependencyContainer ?? new Container($config));
		$this->dependencyContainer->add('fuel.application', $this);
		$this->dependencyContainer->addServiceProvider(new ApplicationServicesProvider());
	}

	public function setDependencyContainer(ContainerInterface $dependencyContainer)
	{
		$this->dependencyContainer = $dependencyContainer;
	}

	public function getDependencyContainer() : ContainerInterface
	{
		return $this->dependencyContainer;
	}

}<commit_msg>Adds a rough outline of request/response logic<commit_after><?php
/**
 * @package    Fuel\Foundation
 * @version    2.0
 * @author     Fuel Development Team
 * @license    MIT License
 * @copyright  2010 - 2016 Fuel Development Team
 * @link       http://fuelphp.com
 */

declare(strict_types=1);

namespace Fuel\Foundation;

use Fuel\Dependency\Container;
use League\Container\ContainerInterface;

class Application
{
	/**
	 * @var ContainerInterface
	 */
	protected $dependencyContainer;

	public static function init(array $config) : Application
	{
		return new static($config);
	}

	public function __construct(array $config, ContainerInterface $dependencyContainer = null)
	{
		$this->setDependencyContainer($dependencyContainer ?? new Container($config));
		$this->dependencyContainer->add('fuel.application', $this);
		$this->dependencyContainer->addServiceProvider(new ApplicationServicesProvider());

		// TODO: register any events from the config

		// TODO: Load components

		// TODO: trigger app created event
	}

	public function setDependencyContainer(ContainerInterface $dependencyContainer)
	{
		$this->dependencyContainer = $dependencyContainer;
	}

	public function getDependencyContainer() : ContainerInterface
	{
		return $this->dependencyContainer;
	}

	public function run()
	{
		// TODO: trigger request started event

		// TODO: route to and call controller

		// TODO: trigger request ended event

		// TODO: trigger response started event

		// TODO: generate and send response

		// TODO: send shutdown event
	}

}
{'fraction_non_alphanumeric': 0.10557843504305503, 'fraction_numerical': 0.008236615499812805, 'mean_word_length': 4.555093555093555, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5068812', 'n_tokens_mistral': 772, 'n_tokens_neox': 685, 'n_words': 190}