original_string: public function getRootUrl($hasProtocol = true)
      {
          $url = $this->getServerName();
          $protocol = $hasProtocol ? $this->getProtocol() : '';
          if (!empty($protocol)) {
              $url = $protocol . $url;
          }
          if (!in_array((integer)$this->getServer('SERVER_PORT'), [80, 443], true)) {
              $url .= ':' . $this->getServer('SERVER_PORT');
          }
          return $url;
      }
code: public function getRootUrl($hasProtocol = true)
      {
          $url = $this->getServerName();
          $protocol = $hasProtocol ? $this->getProtocol() : '';
          if (!empty($protocol)) {
              $url = $protocol . $url;
          }
          if (!in_array((integer)$this->getServer('SERVER_PORT'), [80, 443], true)) {
              $url .= ':' . $this->getServer('SERVER_PORT');
          }
          return $url;
      }
code_tokens: public function getRootUrl ( $ hasProtocol = true ) { $ url = $ this -> getServerName ( ) ; $ protocol = $ hasProtocol ? $ this -> getProtocol ( ) : '' ; if ( ! empty ( $ protocol ) ) { $ url = $ protocol . $ url ; } if ( ! in_array ( ( integer ) $ this -> getServer ( 'SERVER_PORT' ) , [ 80 , 443 ] , true ) ) { $ url .= ':' . $ this -> getServer ( 'SERVER_PORT' ) ; } return $ url ; }
docstring: Devuelve la url completa de base
  @param boolean $hasProtocol
  @return string
docstring_tokens: Devuelve la url completa de base