public function get($key, $default = null, $first = true)
    {
        if(!is_string($key) && !is_int($key)){
            throw new \InvalidArgumentException('$key expected to be string or integer, got: '.gettype($key));
        }

        if (!array_key_exists($key, $this->container)) {
            if (null === $default) {
                return $first ? null : array();
            }

            return $first ? $default : array($default);
        }

        if ($first) {
            return count($this->container[$key]) ? $this->container[$key][0] : $default;
        }

        return $this->container[$key];
    }
public function get($key, $default = null, $first = true)
    {
        if(!is_string($key) && !is_int($key)){
            throw new \InvalidArgumentException('$key expected to be string or integer, got: '.gettype($key));
        }

        if (!array_key_exists($key, $this->container)) {
            if (null === $default) {
                return $first ? null : array();
            }

            return $first ? $default : array($default);
        }

        if ($first) {
            return count($this->container[$key]) ? $this->container[$key][0] : $default;
        }

        return $this->container[$key];
    }
public function get ( $ key , $ default = null , $ first = true ) { if ( ! is_string ( $ key ) && ! is_int ( $ key ) ) { throw new \ InvalidArgumentException ( '$key expected to be string or integer, got: ' . gettype ( $ key ) ) ; } if ( ! array_key_exists ( $ key , $ this -> container ) ) { if ( null === $ default ) { return $ first ? null : array ( ) ; } return $ first ? $ default : array ( $ default ) ; } if ( $ first ) { return count ( $ this -> container [ $ key ] ) ? $ this -> container [ $ key ] [ 0 ] : $ default ; } return $ this -> container [ $ key ] ; }
Returns a email value by name.

@param string  $key     The email name
@param mixed   $default The default value
@param Boolean $first   Whether to return the first value or all email values

@return string|array The first email value if $first is true, an array of values otherwise
Returns a email value by name .