src/Anshar/Http/UriParts/Port.php
public function normalizePortAgainstScheme(Scheme $scheme = null)
    {
        $scheme_port_array = new ArrayHelper($this->scheme_ports);
        $scheme_string     = (string) $scheme;

        $standard_port = $scheme_port_array->valueLookup($scheme_string);

        if ($this->port == $standard_port) {
            $normalized_port = null;
        } else {
            $normalized_port = $this->port;
        }

        return $normalized_port;
    }
public function normalizePortAgainstScheme(Scheme $scheme = null)
    {
        $scheme_port_array = new ArrayHelper($this->scheme_ports);
        $scheme_string     = (string) $scheme;

        $standard_port = $scheme_port_array->valueLookup($scheme_string);

        if ($this->port == $standard_port) {
            $normalized_port = null;
        } else {
            $normalized_port = $this->port;
        }

        return $normalized_port;
    }
public function normalizePortAgainstScheme ( Scheme $ scheme = null ) { $ scheme_port_array = new ArrayHelper ( $ this -> scheme_ports ) ; $ scheme_string = ( string ) $ scheme ; $ standard_port = $ scheme_port_array -> valueLookup ( $ scheme_string ) ; if ( $ this -> port == $ standard_port ) { $ normalized_port = null ; } else { $ normalized_port = $ this -> port ; } return $ normalized_port ; }
Normalizes the port against a given scheme so that the scheme is reported as null if the port is standard for the
scheme.

For example, given a http scheme and a port of 80, the normalized port will be reported as null; given a https
scheme and a port of 80, the normalized port will be reported as 80.

@see Port::toUriString()
@see SchemePortsTrait

@param Scheme|null $scheme
@return int|null
Normalizes the port against a given scheme so that the scheme is reported as null if the port is standard for the scheme .