original_string: public function scanPortRange() {
          if (strtolower($this->typePort) == 'tcp') {
              $hostIp = $this->hostIP;
          } else if (strtolower($this->typePort) == 'udp') {
              $hostIp = "udp://$this->hostIP";
          } else {
              throw new \Exception('Port Type undefined!');
          }
  
          $errno = $errstr = null;
          for ($portNumber = $this->startPort; $portNumber <= $this->endPort; $portNumber++) {
              $handle = @fsockopen($hostIp, $portNumber, $errno, $errstr, $this->timeout);
              if ($handle) {
                  $service = $this->getService($portNumber, strtolower($this->typePort));
                  $this->openPorts[$portNumber] = (!empty($service)) ? $service : null;
                  fclose($handle);
              }
          }
          return $this->openPorts;
      }
code: public function scanPortRange() {
          if (strtolower($this->typePort) == 'tcp') {
              $hostIp = $this->hostIP;
          } else if (strtolower($this->typePort) == 'udp') {
              $hostIp = "udp://$this->hostIP";
          } else {
              throw new \Exception('Port Type undefined!');
          }
  
          $errno = $errstr = null;
          for ($portNumber = $this->startPort; $portNumber <= $this->endPort; $portNumber++) {
              $handle = @fsockopen($hostIp, $portNumber, $errno, $errstr, $this->timeout);
              if ($handle) {
                  $service = $this->getService($portNumber, strtolower($this->typePort));
                  $this->openPorts[$portNumber] = (!empty($service)) ? $service : null;
                  fclose($handle);
              }
          }
          return $this->openPorts;
      }
code_tokens: public function scanPortRange ( ) { if ( strtolower ( $ this -> typePort ) == 'tcp' ) { $ hostIp = $ this -> hostIP ; } else if ( strtolower ( $ this -> typePort ) == 'udp' ) { $ hostIp = "udp://$this->hostIP" ; } else { throw new \ Exception ( 'Port Type undefined!' ) ; } $ errno = $ errstr = null ; for ( $ portNumber = $ this -> startPort ; $ portNumber <= $ this -> endPort ; $ portNumber ++ ) { $ handle = @ fsockopen ( $ hostIp , $ portNumber , $ errno , $ errstr , $ this -> timeout ) ; if ( $ handle ) { $ service = $ this -> getService ( $ portNumber , strtolower ( $ this -> typePort ) ) ; $ this -> openPorts [ $ portNumber ] = ( ! empty ( $ service ) ) ? $ service : null ; fclose ( $ handle ) ; } } return $ this -> openPorts ; }
docstring: Scan range ports in host
  @return array
  @throws \Exception
docstring_tokens: Scan range ports in host