public function get(string $field)
    {
        if ($field === "secure")
            return $this->scheme === "https";

        if ($field === "port" && $this->port === null)
        {
            if ($this->scheme === "http") return 80;
            if ($this->scheme === "https") return 443;
            if ($this->scheme === "ftp") return 21;
        }

        if ($field === "suffix")
            return $this->getSuffix();
                
        if ($field === "query")
            return $this->getQuery();

        if (property_exists($this, $field))
            return $this->$field;

        throw new \OutOfRangeException($field);
    }
public function get(string $field)
    {
        if ($field === "secure")
            return $this->scheme === "https";

        if ($field === "port" && $this->port === null)
        {
            if ($this->scheme === "http") return 80;
            if ($this->scheme === "https") return 443;
            if ($this->scheme === "ftp") return 21;
        }

        if ($field === "suffix")
            return $this->getSuffix();
                
        if ($field === "query")
            return $this->getQuery();

        if (property_exists($this, $field))
            return $this->$field;

        throw new \OutOfRangeException($field);
    }
public function get ( string $ field ) { if ( $ field === "secure" ) return $ this -> scheme === "https" ; if ( $ field === "port" && $ this -> port === null ) { if ( $ this -> scheme === "http" ) return 80 ; if ( $ this -> scheme === "https" ) return 443 ; if ( $ this -> scheme === "ftp" ) return 21 ; } if ( $ field === "suffix" ) return $ this -> getSuffix ( ) ; if ( $ field === "query" ) return $ this -> getQuery ( ) ; if ( property_exists ( $ this , $ field ) ) return $ this -> $ field ; throw new \ OutOfRangeException ( $ field ) ; }
Get the value for a field
@param string field The field to get
@return string The value for the field
Get the value for a field