@param array $input

@return CollectionItem[]

@throws \Exception
976648
public function parseManyFromArray( array $input )
    {
        $items = array();
        foreach ($input as $itemArray)
        {
            $items[] = $this->parseOneFromArray($itemArray);
        }

        return $items;
    }
963618
public function open(array $input) : array {
		$input[\Object\Form\Parent2::BUTTON_SUBMIT_SAVE] = true;
		$input[\Object\Form\Parent2::BUTTON_SUBMIT_OPEN] = true;
		$this->form->form_object->addInput($input);
		$this->form->form_object->process();
		return $this->form->form_object->apiResult();
	}
511161
public function castInput(array $input, array $metadata=[])
    {

        $filtered = [];

        foreach ($input as $key=>$value) {

            // tokens, _method...
            if (starts_with($key,'_')) {
                continue;
            }

            // actions
            if (str_contains($key, '-')) {
                continue;
            }

            if ($this->removeConfirmations && ends_with($key, '_confirmation')) {
                continue;
            }

            $filtered[$key] = $value;
        }

        return NestedArray::toNested($filtered, '__');

    }
688687
public function exchangeArray($input)
    {
        foreach ($input as $item) {
            $this->throwExceptionIfObjectIsNotInstanceOfTheClass($item);
        }

        parent::exchangeArray($input);
    }
63527
public function delete(array $input) : array {
		$input[\Object\Form\Parent2::BUTTON_SUBMIT_SAVE] = true;
		$input[\Object\Form\Parent2::BUTTON_SUBMIT_DELETE] = true;
		$this->form->form_object->addInput($input);
		$this->form->form_object->process();
		return $this->form->form_object->apiResult();
	}
67570
public function extractToAssociativeArray($input)
    {
        $output = array_reduce($input, function($commands, array $item) {
            array_walk($item, function($values, $name) use (&$commands) {
                if (isset($commands[$name]) && !is_array($commands[$name]) && is_array($values)) {
                    $values[] = $values;
                    $commands[$name] = $values;
                } else if (isset($commands[$name]) && is_array($commands[$name]) && is_array($values)) {
                    $commands[$name] = array_merge($commands[$name], $values);
                } else if (isset($commands[$name])) { // if $commands[$name] is set, turn it into an array
                    $commands[$name] = [ $commands[$name], $values ];
                } else { // if $commands[$name] is not set
                    $commands[$name] = $values;
                }
            });

            return $commands;
        }, []);

        return $output;
    }
651212
protected function cleanArray($input)
	{
		// add to the cleaned list when object
		if (is_object($input))
		{
			$this->parent->isClean($input);
		}

		foreach ($input as $k => $v)
		{
			$input[$k] = $this->clean($v);
		}

		return $input;
	}
1006208
public static function clearInput($input)
    {
        if (is_array($input)) {
            foreach ($input as $key => $value) {
                if (!isset($value) || $value === '') {
                    unset($input[$key]);
                }
            }

            return $input;
        }

        return $input;
    }
283052
private function remapFiles(array $input)
    {
        $output = array();

        foreach ($input as $name => $array) {
            foreach ($array as $field => $value) {
                $pointer = &$output[$name];
                if (!is_array($value)) {
                    $pointer[$field] = $value;
                    continue;
                }

                $stack = array(&$pointer);
                $iterator = new RecursiveIteratorIterator(new RecursiveArrayIterator($value), RecursiveIteratorIterator::SELF_FIRST);

                foreach ($iterator as $key => $value) {
                    array_splice($stack, $iterator->getDepth() + 1);
                    $pointer = &$stack[count($stack) - 1];
                    $pointer = &$pointer[$key];
                    $stack[] = &$pointer;

                    if (!$iterator->hasChildren()) {
                        $pointer[$field] = $value;
                    }
                }
            }
        }

        // Remove broken files as well
        return $this->removeBrokenFiles($output);
    }
858047
protected function getFileCollection($input)
    {
        /** @var ConfigurationHelper $configurationHelper */
        $configurationHelper = $this->getHelper('phpdocumentor_configuration');

        $this->files->setAllowedExtensions(
            $configurationHelper->getOption(
                $input,
                'extensions',
                'parser/extensions',
                array('php', 'php3', 'phtml'),
                true
            )
        );
        $this->files->setIgnorePatterns($configurationHelper->getOption($input, 'ignore', 'files/ignore', array(), true));
        $ignoreHidden = $configurationHelper->getOption($input, 'hidden', 'files/ignore-hidden', 'off');
        $this->files->setIgnoreHidden($ignoreHidden !== 'off' && $ignoreHidden === false);
        $this->files->setFollowSymlinks(
            $configurationHelper->getOption($input, 'ignore-symlinks', 'files/ignore-symlinks', 'off') == 'on'
        );

        $file_options = (array) $configurationHelper->getOption($input, 'filename', 'files/files', array(), true);
        $added_files = array();
        foreach ($file_options as $glob) {
            if (!is_string($glob)) {
                continue;
            }

            $matches = glob($glob);
            if (is_array($matches)) {
                foreach ($matches as $file) {
                    if (!empty($file)) {
                        $file = realpath($file);
                        if (!empty($file)) {
                            $added_files[] = $file;
                        }
                    }
                }
            }
        }
        $this->files->addFiles($added_files);

        $directory_options = $configurationHelper->getOption($input, 'directory', 'files/directories', array(), true);
        $added_directories = array();
        foreach ($directory_options as $glob) {
            if (!is_string($glob)) {
                continue;
            }

            $matches = glob($glob, GLOB_ONLYDIR);
            if (is_array($matches)) {
                foreach ($matches as $dir) {
                    if (!empty($dir)) {
                        $dir = realpath($dir);
                        if (!empty($dir)) {
                            $added_directories[] = $dir;
                        }
                    }
                }
            }
        }
        $this->files->addDirectories($added_directories);

        return $this->files;
    }
7936
protected function buildSyncData(array $input)
    {
        $syncData = [];
        foreach ($input['data'] as $item) {
            $syncData[$item['id']] = ['weight' => isset($item['weight']) ? $item['weight'] : 0];
        }
        return $syncData;
    }
202360
private static function collectClosures(&$input) {
        static $closureNo = 1;
        $closures = [];
        if (is_array($input)) {
            foreach ($input as &$value) {
                if (is_array($value) || $value instanceof Closure) {
                    $closures = array_merge($closures, self::collectClosures($value));
                }
            }
        } elseif ($input instanceof Closure) {
            $closureNo++;
            $key = "--==<<[[((Closure#$closureNo))]]>>==--";
            $closures[$key] = $input;
            $input = $key;
        }

        return $closures;
    }
67812
public static function toMap($input)
    {
        Arguments::define(Boa::map())->check($input);

        if ($input instanceof MapInterface) {
            return $input;
        }

        if (is_array($input) || $input instanceof ArrayObject) {
            return new ArrayMap($input);
        }

        if ($input instanceof ArrayAccess) {
            return new ArrayAccessMap($input);
        }

        throw new CoreException('Unable to build Map');
    }
1111990
public function load($input)
    {
        return array_map(
            function (SplFileInfo $file) {
                return $file->getContents();
            },
            array_values(iterator_to_array($this->getFinder($input)))
        );
    }
783181
protected function toAssocRecursive($input, SplObjectStorage $list): array
    {
        $values = is_iterable($input)
            ? i\iterable_to_array($input)
            : object_get_properties($input, $input instanceof stdClass || $input instanceof DynamicEntity);

        foreach ($values as $key => &$value) {
            if ($value instanceof Entity) {
                $value = $list->contains($value) ? $list[$value] : $this->toAssocEntity($value, $list);

                if ($value === null && !is_int($key)) {
                    unset($values[$key]);
                }
            } elseif (is_iterable($value) || $value instanceof stdClass) {
                $value = $this->toAssocRecursive($value, $list);
            }
        }

        return $values;
    }
723079
protected function handleFileDelete(array $input = [])
    {
        if (array_key_exists(Field::FILE_DELETE_FLAG, $input)) {
            $input[Field::FILE_DELETE_FLAG] = $input['key'];
            unset($input['key']);
        }

        Input::replace($input);

        return $input;
    }
511595
public function validate($input): bool
    {
        $this->exception = new ValidatorException();

        // run chains
        foreach ($this->validators as $key => $validators) {
            // skip validation for non required elements
            if (!isset($input[$key]) && !$validators->isRequired()) {
                continue;
            }
            $this->validateItem($key, $input[$key] ?? null);
        }

        return !$this->hasErrors();
    }