@param array  $item
@param string $key

@return void

@throws JsonRpcInvalidRequestException
193588
private function validateRequiredKey(array $item, string $key) : void
    {
        if (!isset($item[$key])) {
            throw new JsonRpcInvalidRequestException(
                $item,
                sprintf('"%s" is a required key', $key)
            );
        }
    }
253513
function sanitize(&$item, $key)
    {
        if (empty($item)) {
            return;
        }

        if (preg_match($this->values_re, $item)) {
            $item = self::MASK;
        }

        if (empty($key)) {
            return;
        }

        if (preg_match($this->fields_re, $key)) {
            $item = self::MASK;
        }
    }
703620
public function remove(string $key): void
    {
        $this->items = Arr::remove($this->items, $key);
    }
477676
private function load(iterable $data, $item, $key, bool $flush, int &$flushCounter, int &$totalCounter): void
    {
        try {
            ($this->load)($data, $key, $this);
            $this->eventDispatcher->dispatch(new ItemEvent(EtlEvents::LOAD, $item, $key, $this));
        } catch (\Throwable $e) {
            /** @var ItemExceptionEvent $event */
            $event = $this->eventDispatcher->dispatch(new ItemExceptionEvent(EtlEvents::LOAD_EXCEPTION, $item, $key, $this, $e));
            if ($event->shouldThrowException()) {
                throw $e;
            }
            $flushCounter--;
            $totalCounter--;
        }

        if (true === $flush) {
            $this->flush($flushCounter, true);
        }
    }
5970
protected function prepend(array $item)
    {
        if (! $this->isEnabled()) {
            $this->enable();
        }

        $container  = $this->getContainer();
        $currentArr = $container->getArrayCopy();

        array_unshift($currentArr, $item);
        $container->exchangeArray($currentArr);
    }
719430
public function push($item)
	{
		$full_class_name = $this->getFullClassName();

		if (is_array($item)) {
			array_push($this->items, new $full_class_name($item));
		}
		elseif ($item instanceof $full_class_name) {
			array_push($this->items, $item);
		}
	}
139168
public function set(string $name, $item): void
    {
        $this->payloadContainerItems->set($name, $item);
    }
1079161
private function setValue($item) : void
    {
        if (is_string($item)) {
            return;
        }
        $element = $item->getElement();
        $name = $element->name();
        if ($element instanceof File) {
            if (array_key_exists($name, $_FILES)) {
                $element->setValue($_FILES[$name]);
                $element->valueSuppliedByUser(true);
            }
        } elseif (array_key_exists($name, $_POST)) {
            if ($element instanceof Radio) {
                if ($_POST[$name] == $element->getValue()
                    || (is_array($_POST[$name])
                        && in_array($element->getValue(), $_POST[$name])
                    )
                ) {
                    $element->check();
                } else {
                    $element->check(false);
                }
            } else {
                $element->setValue($_POST[$name]);
            }
            $element->valueSuppliedByUser(true);
        } elseif ($element instanceof Radio) {
            $element->check(false);
        }
    }
404551
public static function insertAfter(array &$arr, $key, array $inserted): void
    {
        $offset = self::searchKey($arr, $key);
        if ($offset === null) {
            $arr += $inserted;
        } else {
            ++$offset;
            $arr = \array_slice($arr, 0, $offset, true) + $inserted + \array_slice($arr, $offset, null, true);
        }
    }
22016
protected function configure(Config $config, array $json) : void
    {
        Util::validateJsonConfiguration($json);

        foreach (HookUtil::getValidHooks() as $hook => $class) {
            if (isset($json[$hook])) {
                $this->configureHook($config->getHookConfig($hook), $json[$hook]);
            }
        }
    }
1018637
public function push($value, $key = null)
    {
        if (is_null($key)) {
            $this->items[] = $value;
        } else {
            $this->items[$key] = $value;
        }
    }
271834
public function setItem($obj, $key = null)
    {
        if (!$key) {
            throw new KeyInvalidException("A key is required.");
        } elseif (!is_string($key)) {
            throw new KeyInvalidException("The key should be a string.");
        } else {
            if (!array_key_exists($key, $this->getItems())) {
                throw new KeyInvalidException("Invalid key $key.");
            }
            $this->items[$key] = $obj;
        }

        return $this;
    }
48314
public function set($key, $value = null)
    {
        $keys = is_array($key) ? $key : [$key => $value];

        foreach ($keys as $key => $value) {
            Arr::set($this->items, $key, $value);
        }
    }
182701
public function set(DataItem $item): void
    {
        $command = [
            'command' => 'set',
            'key' => $item->key,
            'body' => $item->value,
            'metadata.*' => ''
        ];
        $metadataAsArray = $item->metadata->toArray();
        foreach ($metadataAsArray as $name => $value) {
            $command['metadata.' . $name] = $value;
        }
        $this->execute([$command]);
    }
1016116
private function skip($item, $key): void
    {
        $this->shouldSkip = false;
        $this->eventDispatcher->dispatch(new ItemEvent(EtlEvents::SKIP, $item, $key, $this));
    }
1011214
protected function validate(array $item)
    {
        $object = $this->objectFactory->factor($item);
        $list = $this->validator->validate($object);

        return $list;
    }
1280760
public static function key_exists($array, $key)
    {
        if (!is_array($array) and !$array instanceof ArrayAccess) {
            throw new InvalidArgumentException('First parameter must be an array or ArrayAccess object.');
        }

        is_object($key) and $key = (string) $key;

        if (!is_string($key)) {
            return false;
        }
        if (array_key_exists($key, $array)) {
            return true;
        }
        foreach (explode('.', $key) as $key_part) {
            if (($array instanceof ArrayAccess and isset($array[$key_part])) === false) {
                if (!is_array($array) or ! array_key_exists($key_part, $array)) {
                    return false;
                }
            }
            $array = $array[$key_part];
        }
        return true;
    }