403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/seo/lib/webhook/payload/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/seo/lib/webhook/payload/item.php
<?
/**
 * Bitrix Framework
 * @package bitrix
 * @subpackage seoproxy
 * @copyright 2001-2018 Bitrix
 */
namespace Bitrix\Seo\WebHook\Payload;

use Bitrix\Main\ArgumentException;

/**
 * Class Item
 *
 * @package Bitrix\Seo\WebHook\Payload
 */
abstract class Item
{
	/** @var  array $data Data. */
	protected $data = [
		'source' => null
	];

	/**
	 * Item constructor.
	 *
	 * @param array $data Data.
	 */
	public function __construct(array $data)
	{
		$this->setData($data);
	}

	/**
	 * Get data.
	 *
	 * @return array
	 */
	public function getData()
	{
		return $this->data;
	}

	/**
	 * Set data.
	 *
	 * @param array $data Data.
	 * @return $this
	 */
	public function setData(array $data)
	{
		foreach ($data as $key => $value)
		{
			$this->set($key, $value);
		}

		return $this;
	}

	/**
	 * Get source.
	 *
	 * @return string
	 * @throws ArgumentException
	 */
	public function get($key)
	{
		if (!array_key_exists($key, $this->data))
		{
			throw new ArgumentException("Unknown key `$key`.");
		}

		return $this->data[$key];
	}

	/**
	 * Set source.
	 *
	 * @param string $key Key.
	 * @param string|array $value Value
	 * @return $this
	 * @throws ArgumentException
	 */
	public function set($key, $value)
	{
		if (!array_key_exists($key, $this->data))
		{
			throw new ArgumentException("Unknown key `$key`.");
		}

		$this->data[$key] = $value;
		return $this;
	}

	/**
	 * Magic method __call.
	 *
	 * @param string $name Name.
	 * @param array $arguments Arguments.
	 * @return mixed
	 * @throws ArgumentException
	 */
	public function __call($name, $arguments)
	{
		$method = mb_substr($name, 0, 3);
		if (in_array($method, ['set', 'get']))
		{
			$key = lcfirst(mb_substr($name, 3));
			return call_user_func_array(array($this, $method), array_merge([$key], $arguments));
		}

		throw new ArgumentException("Method `$name` not found.");
	}
}


Youez - 2016 - github.com/yon3zu
LinuXploit