Remaps multiple singular values to a single plural value.

@param array $value The source values

@return array The remapped values
330561
protected function remapXml($value)
    {
        foreach ($this->xmlRemappings as list($singular, $plural)) {
            if (!isset($value[$singular])) {
                continue;
            }

            $value[$plural] = Processor::normalizeConfig($value, $singular, $plural);
            unset($value[$singular]);
        }

        return $value;
    }
681628
private function serializeValue($value)
    {
        if (is_object($value)) {
            return $this->serializeObjectRecursively($value);
        } elseif (is_array($value)) {
            return $this->serializeArrayRecursively($value);
        }

        return $value;
    }
1029919
public static function fromArray(array $value)
    {
        $language = null;
        $culture = null;

        if (!empty($value['language'])) {
            $language = $value['language'];
        } elseif ($value[0]) {
            $language = $value[0];
        }

        if (!empty($value['culture'])) {
            $culture = $value['culture'];
        } elseif ($value[1]) {
            $culture = $value[1];
        }

        return new static($language, $culture);
    }
359703
protected function getPossibleArrayTypes(array $value): array
    {
        $noSubTypes = in_array('array', $this->types);

        $types = array_filter($this->types, function($type) use($noSubTypes) {
            return $type === 'array'
                || (!$noSubTypes && substr($type, -2) === '[]')
                || (class_exists($type) && is_a(Traversable::class, $type, true));
        });

        return $noSubTypes ? $types : $this->removeImpossibleArraySubtypes($types, $value);
    }
6104
public function commands(array $value = null)
    {
        if (null === $value) {
            return $this->commands;
        }
        $this->commands = [];
        foreach ($value as $name => $command) {
            $this->command($name, $command);
        }
        return $this;
    }
924328
protected function prefix($value, $prefix)
    {
        if (is_array($value)) {
            return array_map(function ($item) use ($prefix) {
                return $this->prefix($item, $prefix);
            }, $value);
        }

        return $prefix . $value;
    }
463492
public function varReplace($value)
    {
    	if (is_string($value) && !empty($this->vars)) {
            foreach ($this->vars as $key => $val) {
	            $key = '${' . trim($key) . '}';

	            if (empty($val)) {
	                $val = '';
	            }
	            $value = str_ireplace($key, $val, $value);
	        }
        }
        return $value;
    }
928179
public function transform($value)
    {
        if (null === $value) {
            $value = $this->fieldType->getEmptyValue();
        }

        return array_merge(
            $this->getDefaultProperties(),
            ['alternativeText' => $value->alternativeText]
        );
    }
358681
protected function normalize($value)
    {
        if ($value === null) {
            return $value;
        }
        foreach ($this->normalizers as $normalizer) {
            $value = $normalizer($value);
        }

        return $value;
    }
503605
protected static function export(array $value)
	{
		$pairs = [];
		foreach ($value as $k => $v)
		{
			$pairs[] = var_export($k, true) . '=>' . var_export($v, true);
		}

		return '[' . implode(',', $pairs) . ']';
	}
621884
protected function mapInfoForValue($value) {
		if ($this->processor->startsWith($value, '\'') && $this->processor->endsWith($value, '\'')) {
			return ['around' => '\''];
		}

		if ($this->processor->startsWith($value, '"') && $this->processor->endsWith($value, '"')) {
			return ['around' => '"'];
		}
	}
814747
public function resolveLinks($value)
    {
        if (is_array($value)) {
            return array_map([$this, 'resolveLinks'], $value);
        }

        if (is_string($value) && strpos($value, '{@') !== false) {
            $value = $this->resolveLinksInString($value);
        }

        return $value;
    }
107795
protected function _normalizeArray($value)
    {
        if ($value instanceof stdClass) {
            $value = (array) $value;
        }

        if (is_array($value)) {
            return $value;
        }

        if (!($value instanceof Traversable)) {
            throw $this->_createInvalidArgumentException($this->__('Not an iterable'), null, null, $value);
        }

        $value = iterator_to_array($value, true);

        return $value;
    }
224887
protected function resolvePropertyReferences(array $value = []): array
    {
        $nodes = array_map(function ($nodeIdentifier) {
            return $this->context->getNodeByIdentifier($nodeIdentifier);
        }, $value);

        return array_filter($nodes);
    }
11290
public function entities($value)
    {
        if (is_array($value)) {
            $newValue = array();
            foreach ($value as $key => $val) {
                $newValue[$key] = htmlentities($val, ENT_QUOTES, 'UTF-8', false);
            }

            return $newValue;
        }

        return htmlentities($value, ENT_QUOTES, 'UTF-8', false);
    }
161589
protected function transformRecursive($value)
    {
        if (is_array($value)) {
            if (array_key_exists('#comment', $value)) {
                unset($value['#comment']);
            }

            foreach ($value as &$subvalue) {
                $subvalue = $this->transformRecursive($subvalue);
            }
        }

        return $value;
    }
703223
public static function allToArray($value)
    {
        if ($value instanceof \Traversable) {
            $value = iterator_to_array($value);
        }

        if (is_object($value)) {
            $value = get_object_vars($value);
        }

        $value = (array) $value;

        foreach ($value as $k => $v) {
            if (!static::isValidValue($v)) {
                throw new \InvalidArgumentException('Value :' . $value . ' is invalid.');
            }
        }

        return $value;
    }