Your IP : 216.73.216.86


Current Path : /var/www/homesaver/www/bitrix/modules/location/lib/infrastructure/service/config/
Upload File :
Current File : /var/www/homesaver/www/bitrix/modules/location/lib/infrastructure/service/config/container.php

<?php

namespace Bitrix\Location\Infrastructure\Service\Config;

use \Bitrix\Location\Exception\ErrorCodes;

final class Container
{
	private $configValues = [];

	public function __construct(array $configValues)
	{
		$this->configValues = $configValues;
	}

	public function get($id)
	{
		if(!$this->has($id))
		{
			throw new \LogicException(
				"Sevice configuration container does not contain '{$id}' value",
				ErrorCodes::SERVICE_CONFIG_VALUE_NOT_FOUND
			);
		}

		return $this->configValues[$id];
	}

	public function has($id)
	{
		return array_key_exists($id, $this->configValues);
	}
}