registerArgument('array', 'array', 'Array to add value to'); $this->registerArgument('key', 'string', 'Key to add value by', true); $this->registerArgument('value', 'mixed', 'Value to add'); } /** * @param array $arguments * @param \Closure $renderChildrenClosure * @param RenderingContextInterface $renderingContext * * @return array */ public static function renderStatic( array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext ) { $array = $arguments['array'] ?: []; $key = $arguments['key']; $value = $arguments['value'] ?: $renderChildrenClosure(); return array_merge($array, [$key => $value]); } }