Parse the item's type and value

@param Container $container
@param string    $name

@return array|null
775247
protected function parseItem(Container $container, $name)
    {
        try {
            $element = $container[$name];
        } catch (\Exception $e) {
            if (array_key_exists($name, $this->outOfRequestScopeTypes)) {
                return [
                  'name' => $name,
                  'type' => 'class',
                  'value' => $this->outOfRequestScopeTypes[$name],
                ];
            }
            return null;
        }

        if (is_object($element)) {
            if ($element instanceof \Closure) {
                $type = 'closure';
                $value = '';
            } elseif ($element instanceof Container) {
                $type = 'container';
                $value = $this->parseContainer($element);
            } else {
                $type = 'class';
                $value = get_class($element);
            }
        } elseif (is_array($element)) {
            $type = 'array';
            $value = '';
        } elseif (is_string($element)) {
            $type = 'string';
            $value = $element;
        } elseif (is_int($element)) {
            $type = 'int';
            $value = $element;
        } elseif (is_float($element)) {
            $type = 'float';
            $value = $element;
        } elseif (is_bool($element)) {
            $type = 'bool';
            $value = $element;
        } elseif ($element === null) {
            $type = 'null';
            $value = '';
        } else {
            $type = 'unknown';
            $value = gettype($element);
        }

        return [
          'name' => $name,
          'type' => $type,
          'value' => $value,
        ];
    }
571436
public static function parsePredict(string $name):array
    {
        $f = ComManager::getFileCommand();
        $meaning = [];
        if ($f == null) {
            throw new Server500(new \ArrayObject(array("explain" =>
                "Framework Predictions Error : Command File is empty",
                "solution" => "Command file cannot not be empty")));
        }
        $commands = $f->commands;

        foreach ($commands as $command => $val) {
            if ($val->type === "single") {
                if (stristr($command, $name) != false) {
                    $meaning[] = $commands;
                }
            } elseif ($val->type === "multiple") {
                foreach ($val->args as $acommand => $aval) {
                    if (stristr($aval->name, $name) != false) {
                        $meaning[] = $aval->name;
                    }
                }
            }
        }
        return ($meaning);
    }
983835
public function get($name)
    {
        $nameString = TypeHinter::to('USVString', $name);
        $value = null;
        foreach ($this->list as $pair) {
            if ($pair[0] === $nameString) {
                $value = $pair[1];
                break;
            }
        }
        return $value;
    }
442849
private function dumpParameter($name)
    {
        if ($this->container->isFrozen() && $this->container->hasParameter($name)) {
            return $this->dumpValue($this->container->getParameter($name), false);
        }

        return sprintf("\$this->getParameter('%s')", strtolower($name));
    }
1119262
public function resolve($name)
    {
        return isset($this->services[$name]) ? $this->container->getService($this->services[$name]) : null;
    }
1268780
public function getBlobData($container = '', $name = '')
    {
        $this->checkConnection();
        try {
            /** @var Container $container */
            $container = $this->blobConn->getContainer($container);
            if (empty($container)) {
                throw new \Exception("No container named '$container'");
            }

            $obj = $container->getObject($name);
            $request = $obj->getClient()->get($obj->getUrl());
            /** @var \Guzzle\Http\Message\Response $result */
            $result = $request->send();

            return $result->getBody(true);
        } catch (\Exception $ex) {
            static::handleGuzzleException($ex);
            throw new DfException("Failed to retrieve blob '$name': " . $ex->getMessage());
        }
    }
1260923
public function getValues($name)
    {
        $return = [];
        $items  = $this->getItems();

        foreach ($items as $type) {
            $method = 'get' . ucfirst($name);
            if (method_exists($type, $method)) {
                $return[] = $type->$method();
            } else {
                $return[] = $type->{$name};
            }
        }

        return $return;
    }
1335346
public function get($name)
    {
        $selected = null;
        /** @var ElementInterface|ContainerInterface $element */
        foreach ($this as $element) {
            if ($element->getName() == $name) {
                $selected = $element;
                break;
            }

            if ($element instanceof ContainerInterface) {
                $selected = $element->get($name);
                if (null !== $selected) {
                    break;
                }
            }
        }

        return $selected;
    }
451070
public static function read(ContainerBuilder $container)
    {
        /** @var InputInterface $input */
        $input = $container->get('input');

        $locations = [getcwd(), getcwd().'/.bldr/'];
        if ($input->hasParameterOption('--global')) {
            $locations = array_merge($locations, [getenv('HOME'), getenv('HOME').'/.bldr/']);
        }

        $locator  = new FileLocator($locations);
        $resolver = new LoaderResolver(
            [
                new Loader\YamlFileLoader($container, $locator),
                new Loader\XmlFileLoader($container, $locator),
                new Loader\PhpFileLoader($container, $locator),
                new Loader\IniFileLoader($container, $locator),
                new Loader\JsonFileLoader($container, $locator),
                new Loader\TomlFileLoader($container, $locator)
            ]
        );

        $loader      = new DelegatingLoader($resolver);
        $files       = static::findFiles($input);
        $foundConfig = false;
        foreach ($files as $file) {
            try {
                $loader->load($file);
                $foundConfig = true;
            } catch (\Exception $e) {
                if (get_class($e) !== 'InvalidArgumentException') {
                    throw $e;
                }
            }
        }

        if (!$foundConfig) {
            throw new ConfigurationFileNotFoundException(
                sprintf(
                    "Either couldn't find the configuration file, or couldn't read it. ".
                    "Make sure the extension is valid (%s). Tried: %s",
                    implode(', ', static::$TYPES),
                    implode(', ', $files)
                )
            );
        }
    }
1324461
function add($name, $container = null) {
        $method = \Str::studly('add_' . $name);
        if (!$container) {
            $container = $this->form;
        }

        $element = call_user_func([
            $this,
            $method
        ], $container);
        /* @var ElementTbText $element */
        $element->toggleFrozen(!$this->isFieldEnabled($name));
        if (!$element->getLabel()) {
            $element->setLabel($this->model->getEntityLabel($name));
        }
        return $element;
    }
1135092
public function all($name)
    {
        $items = [];

        if ($this->hasValue($name)) {
            $items[] = $this->getValue($name);
        }

        foreach ($this->getStructures() as $childStructure) {
            $items = array_merge($items, $childStructure->all($name));
        }

        return $items;
    }
190938
public static function get($name = null)
    {
        if ($name === null) {
            $name = array_shift(array_keys(self::$containers));
        }
        return self::$containers[$name] ? self::$containers[$name] : null;
    }
345242
public function getOptions(ContainerInterface $container, $key, $name = null)
    {
        if ($name === null) {
            $name = $this->getName();
        }

        $options = $container->get('config');
        $options = $options['doctrine'];
        if ($mappingType = $this->getMappingType()) {
            $options = $options[$mappingType];
        }
        $options = isset($options[$key][$name]) ? $options[$key][$name] : null;

        if (null === $options) {
            throw new RuntimeException(
                sprintf(
                    'Options with name "%s" could not be found in "doctrine.%s".',
                    $name,
                    $key
                )
            );
        }

        $optionsClass = $this->getOptionsClass();

        return new $optionsClass($options);
    }
1322558
private function parseCallableController($controller, $container)
    {
        $controller  = rtrim($this->namespace, "\\") . "\\" . $this->parseCallablePlaceholders($controller);

        if ($container === null) {
               return new $controller;
        } else return $container($controller);
    }
288881
public function getResourceType($name)
    {
        if (isset($this->types[$name])) {
            return $this->types[$name];
        }

        return null;
    }
1137407
public function getType( $name, $prefix = null )
	{
		// It can be the case that the type passed in is an array.  This can happen if the type for an
		// element is defined in the schema as simpleContent extending some base type by restriction.
		// In case this could be the case, look for an array with an element key of 'class' and value
		// 'simple'. If found, there should be an element with a key of 'parent'.  Use this.
		if ( is_array( $name ) && isset( $name['class'] ) && isset( $name['parent'] ) )
		{
			$name = $name['parent'];
		}

		if ( strpos( $name, ":" ) === false && is_null( $prefix ) )
		{
			// Assume xs
			$prefix = "xs";
		}

		return $this->hasType( $name, $prefix )
			? $this->types[ is_null( $prefix ) ? $name : "$prefix:$name" ]
			: false;
	}
448007
public function get($name)
    {
        $item = $this->getFactory($name)->get();

        if ($item instanceof ContainerAwareInterface) {
            $item->setContainer($this);
        }

        return $item;
    }