<commit_before><?php
namespace Squanch\Boot;


use Squanch\Base\ICallback;
use Squanch\Enum\Callbacks;
use Squanch\Objects\Instance;
use Squanch\Base\Boot\IConfigLoader;
use Squanch\Exceptions\SquanchInstanceException;
use Squanch\Exceptions\SquanchUnknownCallbackException;


class ConfigLoader implements IConfigLoader
{
	private $instances = [];
	
	
	public function addInstance(Instance $instance, bool $override = false): IConfigLoader
	{
		$instanceWorkName = $instance->Name . $instance->Type . $instance->Priority;
		
		if (isset($this->instances[$instanceWorkName]))
		{
			throw new SquanchInstanceException('Instance with the same parameters already exists. Use override.');
		}
		
		$this->instances[$instanceWorkName] = $instance;
		
		return $this;
	}
	
	/**
	 * @return Instance[]
	 */
	public function getInstances(): array
	{
		return array_values($this->instances);
	}
}<commit_msg>Added override to ConfigLoader<commit_after><?php
namespace Squanch\Boot;


use Squanch\Objects\Instance;
use Squanch\Base\Boot\IConfigLoader;
use Squanch\Exceptions\SquanchInstanceException;


class ConfigLoader implements IConfigLoader
{
	private $instances = [];
	
	
	public function addInstance(Instance $instance, bool $override = false): IConfigLoader
	{
		$instanceWorkName = $instance->Name . $instance->Type . $instance->Priority;
		
		if (isset($this->instances[$instanceWorkName]) && !$override)
		{
			throw new SquanchInstanceException('Instance with the same parameters already exists. Use override.');
		}
		
		$this->instances[$instanceWorkName] = $instance;
		
		return $this;
	}
	
	/**
	 * @return Instance[]
	 */
	public function getInstances(): array
	{
		return array_values($this->instances);
	}
}
{'fraction_non_alphanumeric': 0.12041884816753927, 'fraction_numerical': 0.0, 'mean_word_length': 4.890410958904109, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, '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': '4533597', 'n_tokens_mistral': 561, 'n_tokens_neox': 495, 'n_words': 114}