@param $name
@return array [hello, world, to, you]
[hello, world, to, you]
represents $_PUT['hello']['world']['to']['you']

[hello]
represents $_PUT['hello']
330578
protected function parseFieldName($name)
    {
        $start = strpos($name, '[', 0);
        if ($start === false) { // No `[` found, $_PUT['hello']
            return [$name];
        } else if ($start === 0) { // Discard field name start with `[`
            return false;
        }

        $end = strpos($name, ']', $start);
        if ($end === false) { // `[` found, but not the `]`
            return [str_replace('[', '_', $name)];
        }

        // Definitely paired brackets found
        $first = substr($name, 0, $start);
        $name = substr($name, $start);
        // Strip the well-formed part of the name, such as `hello[world]xxx` -> `hello[world]`
        if (preg_match('#^(?:\[[^\]]*\])+#', $name, $wellFormedMatch)) {
            // Get parts for the array
            if (preg_match_all('#\[([^\]]*)\]#', $wellFormedMatch[0], $match)) {
                array_unshift($match[1], $first);
                return $match[1];
            }
        }

        return false;
    }
798243
public static function getOptions(string $name): array
    {
        if (isset(self::$options) && is_array(self::$options))
            return self::$options[$name];
        return [];
    }
708324
public function getStackOperationsByName($name)
    {
        $stackOperations = [];
        foreach ($this->stackOperations as $stackOperation) {
            if ($stackOperation->name === $name) {
                $stackOperations[] = $stackOperation;
            }
        }

        return $stackOperations;
    }
641410
private function getScanNamespaceFromProperties(string $name)
    {
        $properties = $this->properties;

        if (!isset($properties[$name]) || !\is_array($properties[$name])) {
            return [];
        }

        return $properties[$name];
    }
457129
public function getMissingLocalesForBlockName($name)
    {
        $locales = array();
        foreach ($this->locales as $locale)
        {
            if (!$this->hasContentBlock($name, $locale))
            {
                $locales[$locale] = $locale;
            }
        }

        return $locales;
    }
212707
public function getArguments($name)
    {
        if (null === $this->data) {
            $this->initializeProfile();
        }

        if (!isset($this->data['arguments'][$name])) {
            return array();
        }

        $arguments = array();
        foreach ($this->data['arguments'][$name] as $argument => $cost) {
            $arguments[$argument] = new Cost($cost);
        }

        return $arguments;
    }
185026
public function getFieldAsArray(string $name): array
    {
        $result = $this->getFieldDefinition($name);

        $result['name'] = $name;

        if (empty($result['caption'])) {
            $result['caption'] = $this->_($result['name']);
        }

        $value = $this->$name;
        $type = @$result['type'];

        if (($type == 'date' || $type == 'datetime' || $type == 'time') && is_object($value)) {
            $value = $value->format($this->translate('form.' . $type));
        }

        $result['value'] = $value;
        $result['uid'] = 'id' . uniqid();

        if (isset($result['options']) && is_array($result['options'])) {
            $options = array();

            foreach ($result['options'] as $option => $label) {
                $options[] = array('option' => $option, 'label' => $label);
            }

            $result['options'] = $options;
        }

        return $result;
    }
805156
public static function get(string $name)
    {
        return (isset($_GET[$name]) && $_GET[$name] != '') ? $_GET[$name] : '';
    }
1258037
protected function parseAlias($name)
    {
        if (strpos($name, ' ') !== false && preg_match('/^\s*(.+)(\s+as\s+)(.+)\s*$/i', $name, $matches)) {
            return array($matches[1], $matches[3]);
        }

        return array($name, null);
    }
1350606
public function getInjectedDefinitions($name)
    {
        $names = (array) $name;
        $visited = array();

        foreach ($names as $name) {
            $this->doGetInjectedDefinitions($name, $visited);
        }

        return $visited;
    }
776821
protected function generatePluginHeaders(string $name)
    {
        $description = $this->ask('Description:', '');
        $author = $this->ask('Author:', 'Themosis');
        $textdomain = $this->ask('Text domain:', trim($name, '\/-_'));
        $variable = strtoupper($this->ask('Domain variable:', 'PLUGIN_TD'));
        $prefix = $this->ask('Plugin prefix:', str_replace(['-', ' '], '_', $name));
        $namespace = $this->ask('PHP Namespace:', 'Tld\Domain\Plugin');

        return [
            'name' => ucwords(str_replace(['-', '_'], ' ', $name)),
            'description' => $description,
            'author' => $author,
            'text_domain' => $textdomain,
            'domain_var' => $variable,
            'plugin_prefix' => $prefix,
            'plugin_namespace' => $namespace,
            'plugin_id' => $name
        ];
    }
1155589
private function parseReferences($name): string
    {
        if (preg_match_all('/\$\{(.*[a-z\.0-9])\}/si', $name, $results, PREG_SET_ORDER)) {
            foreach ($results as $match) {
                $replace = $match[0];
                $key = $match[1];

                // Handle using relative placement like get('db.${.default}.host');
                if (strpos($key, '.') === 0) {
                    // using relative placement
                    $key = substr($name, 0, strpos($name, $replace) - 1) . $key;
                }

                // get the value
                $value = $this->get($key);
                if ($value === null || $value === '' || $value === false) {
                    throw new InvalidArgumentException(
                        $key . ' replacement for ' . $name . ' must not be null or empty'
                    );
                }

                $name = str_replace($replace, $value, $name);
            }
        }

        return $name;
    }
115904
public function &__get($name)
    {
        // This method must return a reference and not use ternary operators for __set()ing multi-dimensional arrays
        // http://stackoverflow.com/questions/4310473/using-set-with-arrays-solved-but-why
        // http://stackoverflow.com/questions/5966918/return-null-by-reference-via-get
        switch ($name) {
            case 'global':
                if (is_null(static::$global)) {
                    static::$global = new Container;
                }

                return static::$global;
                break;
            case 'session':
                if (is_null(static::$session)) {
                    static::$session = new Session;
                }

                return static::$session;
                break;
            case 'request':
            case 'dir':
            case 'url':
            case 'html':
                return $this->$name;
                break;
            default:
                return $this->html[strtolower($name)];
                break;
        }
    }
728666
public function PushVar( $name )
	{
		$id = $this->NewReference();
		$this->_slots[] = new NameSlot( $id, $name );
		return $id;
	}
23836
static function read($name)
    {
        if (!isset(self::$loaded[$name])) {
            self::$loaded[$name] = [];
            foreach (self::$dirs as $dir) {
                try {
                    $c = include $dir . $name . '.php';
                    self::$loaded[$name] = array_merge_recursive(self::$loaded[$name], $c);
                } catch (\Exception $e) {
                }
            }
        }
        return self::$loaded[$name];
    }
190360
protected function getComponentParams(string $name): array
    {
        switch ($name) {
            case 'client':
                $params = [$this->clientConfig];
                break;
            case 'resolver':
                $params = [$this->getComponent('client')];
                break;
            case 'bus':
                $params = [$this->getComponent('resolver')];
                break;
            case 'builder':
                $params = [$this->getComponent('bus'), $this->defaultBucket, $this->defaultAcl];
                break;
            case 'factory':
                $params = [$this->getComponent('builder')];
                break;
            default:
                $params = [];
        }

        return $params;
    }
395430
public function parseTable($name): array
    {
        if ($name instanceof Model) {
            return [$name->alias(), $name->name()];
        }

        if (is_array($name)) {
            return [key($name), current($name)];
        }

        if (is_scalar($name)) {
            return static::parseName($name);
        }

        return [null, $name];
    }