original_string: protected function port_is_blocked($port) {
          $portnum = intval($port);
          // Intentionally block port 0 and below and check the int cast was valid.
          if (empty($port) || (string)$portnum !== (string)$port || $port < 0) {
              return true;
          }
          $allowedports = $this->get_whitelisted_ports();
          return !empty($allowedports) && !in_array($portnum, $allowedports);
      }
code: protected function port_is_blocked($port) {
          $portnum = intval($port);
          // Intentionally block port 0 and below and check the int cast was valid.
          if (empty($port) || (string)$portnum !== (string)$port || $port < 0) {
              return true;
          }
          $allowedports = $this->get_whitelisted_ports();
          return !empty($allowedports) && !in_array($portnum, $allowedports);
      }
code_tokens: protected function port_is_blocked ( $ port ) { $ portnum = intval ( $ port ) ; // Intentionally block port 0 and below and check the int cast was valid. if ( empty ( $ port ) || ( string ) $ portnum !== ( string ) $ port || $ port < 0 ) { return true ; } $ allowedports = $ this -> get_whitelisted_ports ( ) ; return ! empty ( $ allowedports ) && ! in_array ( $ portnum , $ allowedports ) ; }
docstring: Checks whether the given port is blocked, as determined by its absence on the ports whitelist.
  Ports are assumed to be blocked unless found in the whitelist.
  
  @param integer|string $port the port to check against the ports whitelist.
  @return bool true if the port is blocked, false otherwise.
docstring_tokens: Checks whether the given port is blocked as determined by its absence on the ports whitelist . Ports are assumed to be blocked unless found in the whitelist .