src/Collection/ParameterCollection.php
public function get(string $name, $default = null)
    {
        $parts = explode('[', $name);
        $lastKey = trim(array_pop($parts), ']');
        $current = &$this->parameters;
        foreach ($parts as $part) {
            $target = trim($part, ']');
            if (!is_array($current) || !array_key_exists($target, $current)) {
                return $default;
            }

            $current = &$current[$target];
        }

        if (!array_key_exists($lastKey, $current)) {
            return $default;
        }

        return $current[$lastKey];
    }
public function get(string $name, $default = null)
    {
        $parts = explode('[', $name);
        $lastKey = trim(array_pop($parts), ']');
        $current = &$this->parameters;
        foreach ($parts as $part) {
            $target = trim($part, ']');
            if (!is_array($current) || !array_key_exists($target, $current)) {
                return $default;
            }

            $current = &$current[$target];
        }

        if (!array_key_exists($lastKey, $current)) {
            return $default;
        }

        return $current[$lastKey];
    }
public function get ( string $ name , $ default = null ) { $ parts = explode ( '[' , $ name ) ; $ lastKey = trim ( array_pop ( $ parts ) , ']' ) ; $ current = & $ this -> parameters ; foreach ( $ parts as $ part ) { $ target = trim ( $ part , ']' ) ; if ( ! is_array ( $ current ) || ! array_key_exists ( $ target , $ current ) ) { return $ default ; } $ current = & $ current [ $ target ] ; } if ( ! array_key_exists ( $ lastKey , $ current ) ) { return $ default ; } return $ current [ $ lastKey ] ; }
Returns the value of a parameter.

@param string $name    name of the parameter
@param mixed  $default return value if the parameter doesn't exist

@return mixed
Returns the value of a parameter .