Create routes from input

@param Route[]|array|stdClass|\Traversable $input
@return type
421412
protected function createRoutes($input)
    {
        if ($input instanceof \Traversable) {
            $input = iterator_to_array($input, true);
        } elseif ($input instanceof \stdClass) {
            $input = get_object_vars($input);
        }

        return array_map([$this, 'createRoute'], $input);
    }
326860
public static function typed(string $type, iterable $input = []): Vector
    {
        $resolver = Resolver::typed($type);

        return new static($input, $resolver);
    }
922539
public function wrap($input): self {
        $this->wrapWithInputByCallback($input, function($node, $stackNodes) {
            // Add the new bottom (root) node after the current node
            $node->after($stackNodes->bottom());

            // Remove the current node
            $oldNode = $node->detach()->first();

            // Add the 'current node' back inside the new top (leaf) node.
            $stackNodes->top()->append($oldNode);
        });

        return $this;
    }
1056729
public function wrapAll($input): self {
        if (!$this->collection()->count()) {
            return $this;
        }

        if (is_callable($input)) {
            $input = $input($this->collection()->first());
        }

        $inputNode = $this->inputAsFirstNode($input);

        if (!($inputNode instanceof Element)) {
            return $this;
        }

        $stackNodes = $this->_prepareWrapStack($inputNode);

        // Add the new bottom (root) node before the first matched node
        $this->collection()->first()->before($stackNodes->bottom());

        $this->collection()->each(function($node) use ($stackNodes) {
            // Detach and add node back inside the new wrappers top (leaf) node.
            $stackNodes->top()->append($node->detach());
        });

        return $this;
    }
123783
public function execute(Input $input): Input
    {

        if (!$input->isEvaluableForTypes(...$this->types)) {
            return $input;
        }

        return $this->resolve($input);
    }
934631
protected function inputPrepareAsTraversable($input): iterable {
        if ($input instanceof \DOMNode) {
            // Handle raw \DOMNode elements and 'convert' them into their DOMWrap/* counterpart
            if (!method_exists($input, 'inputPrepareAsTraversable')) {
                $input = $this->document()->importNode($input, true);
            }

            $nodes = [$input];
        } else if (is_string($input)) {
            $nodes = $this->nodesFromHtml($input);
        } else if (is_iterable($input)) {
            $nodes = $input;
        } else {
            throw new \InvalidArgumentException();
        }

        return $nodes;
    }
172108
public function go($input)
    {
        Arguments::define(Boa::readMap())->define($input);

        $map = ComplexFactory::toReadMap($this->functions);

        if ($map->member($input)) {
            /** @var callable $function */
            $function = Maybe::fromJust($map->lookup($input));

            return $function();
        } elseif ($map->member($this->default)) {
            /** @var callable $function */
            $function = Maybe::fromJust($map->lookup($this->default));

            return $function();
        }

        throw new UnknownKeyException();
    }
1064649
public function input($input): ProcessBuilder
    {
        if ($input === null) {
            $this->input = null;

            return $this;
        }

        if (is_resource($input)) {
            $this->input = $input;

            return $this;
        }

        if (is_scalar($input)) {
            $this->input = (string) $input;
        }

        return $this;
    }
767757
public static function typed(string $type, iterable $input = []): Map
    {
        $resolver = Resolver::typed($type);

        return new static($input, $resolver);
    }
690887
protected function manipulateNodesWithInput($input, callable $callback): self {
        $this->collection()->each(function($node, $index) use ($input, $callback) {
            $html = $input;

            /*if ($input instanceof \DOMNode) {
                if ($input->parentNode !== null) {
                    $html = $input->cloneNode(true);
                }
            } else*/if (is_callable($input)) {
                $html = $input($node, $index);
            }

            $newNodes = $this->inputAsNodeList($html);

            $callback($node, $newNodes);
        });

        return $this;
    }
120006
protected function createMigration($input)
    {
        if ($input->withMigration) {
            $this->call(
                'create:migration',
                [
                    'model-name' => $input->modelName,
                    '--table-name' => $input->table,
                    '--migration-class-name' => $input->migrationClass,
                    '--connection-name' => $input->connectionName,
                    '--engine-name' => $input->engineName,
                    '--resource-file' => $input->resourceFile,
                    '--template-name' => $input->template,
                    '--without-timestamps' => $input->withoutTimeStamps,
                    '--with-soft-delete' => $input->withSoftDelete,
                    '--force' => $input->force,
                ]
            );
        }

        return $this;
    }
175271
public function createGroup(InputStruct $input)
    {
        $objectStateGroup = $this->objectStateMapper->createObjectStateGroupFromInputStruct($input);
        $this->objectStateGateway->insertObjectStateGroup($objectStateGroup);

        return $objectStateGroup;
    }
292982
public function closest($input) {
        $results = $this->_walkPathUntil('parentNode', $input, null, self::$MATCH_TYPE_LAST);

        return $this->result($results);
    }
973258
public function parse($input)
    {
        $this->inValuePath = false;
        $this->lexer->setInput($input);
        $this->lexer->moveNext();

        $node = null;
        if ($this->mode->equals(Mode::FILTER)) {
            $node = $this->disjunction();
        } else {
            $node = $this->path();
        }

        $this->match(null);

        return $node;
    }
307751
public function create(array $inputs = [])
    {
        $inputs = $this->purifyInputs($inputs);

        return $this->model->create($inputs);
    }
836428
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $routes = $this->getContainer()->get('router')->getRouteCollection();
        foreach ($routes->all() as $name => $route) {
            if (!$input->getOption('system') && substr($name, 0, 1) === '_') {
                // Skip paths defined by the framework.
                $routes->remove($name);
                continue;
            }
            $this->convertController($route);
        }

        $destination = $input->getOption('output');
        $format = $input->getOption('format');

        RouteExporter::getExporter($destination, $format)->export($routes);
    }
302773
public function create($input)
	{
		$mapper = $this->getMapper();
		$admin  = $mapper->getAdmin();

		$model      = $this->getModel();
		$primaryKey = (new $model)->getKeyName();

		$this->setInput($input);

		// Field pre update
		foreach ($mapper->getFields() as $field) {
			$field->preUpdate();
			$input = $this->getInput();

			// Is this a multiple field?
			if ($field->isMultiple()) {
				$value = Value::encode(Config::get('bauhaus::admin.multiple-serializer'), $input[$field->getName()]);
				$this->setInputVariable($field->getName(), $value);
			}

			if ($field->hasSaving()) {
				$saving = $field->getSaving();
				$this->setInputVariable($field->getName(), $saving($input[$field->getName()]));
			}
		}

		// Model before create hook
		if (method_exists($admin, 'beforeCreate')) {
			$admin->beforeCreate($input);
		}

		// Validate
		if (property_exists($model, 'rules')) {
			$validator = Validator::make($this->getInput(), $model::$rules);
			if ($validator->fails()) {
				return $validator;
			}
		}

		// Model create hook
		if (method_exists($admin, 'create')) {
			$model = $admin->create($this->getInput());
		} else {
			$model = $model::create($this->getInput());
		}

		// Set the primary id from the `new` model
		$this->setIdentifier($model->{$primaryKey});

		// Field post update
		foreach ($mapper->getFields() as $field) {
			$field->postUpdate($this->getInput());
		}

		// Model after create hook
		if (method_exists($admin, 'afterCreate')) {
			$result = $admin->afterCreate($this->getInput());

			if ($result instanceof \Illuminate\Http\RedirectResponse) {
				$result->send();
			}
		}

		return $this;
	}