original_string: private function filterPort($scheme, $host, $port)
      {
          if (null !== $port) {
              $port = (int) $port;
              if (1 > $port || 65535 < $port) {
                  throw new \InvalidArgumentException(sprintf('Invalid port: %d. Must be between 1 and 65535', $port));
              }
          }
  
          return self::isStandardPort($port, (string) $scheme, (string) $host) ? null : $port;
      }
code: private function filterPort($scheme, $host, $port)
      {
          if (null !== $port) {
              $port = (int) $port;
              if (1 > $port || 65535 < $port) {
                  throw new \InvalidArgumentException(sprintf('Invalid port: %d. Must be between 1 and 65535', $port));
              }
          }
  
          return self::isStandardPort($port, (string) $scheme, (string) $host) ? null : $port;
      }
code_tokens: private function filterPort ( $ scheme , $ host , $ port ) { if ( null !== $ port ) { $ port = ( int ) $ port ; if ( 1 > $ port || 65535 < $ port ) { throw new \ InvalidArgumentException ( sprintf ( 'Invalid port: %d. Must be between 1 and 65535' , $ port ) ) ; } } return self :: isStandardPort ( $ port , ( string ) $ scheme , ( string ) $ host ) ? null : $ port ; }
docstring: Filter port before setting it.
  
  @param string $scheme
  @param string $host
  @param int    $port
  
  @return int|null
  
  @throws \InvalidArgumentException if the port is invalid.
docstring_tokens: Filter port before setting it .