original_string: public function build($type)
      {
          if (!isset(self::$mapping[$type])) {
              throw new UnknownPacketTypeException(sprintf('Unknown packet type %d.', $type));
          }
  
          $class = self::$mapping[$type];
  
          return new $class();
      }
code: public function build($type)
      {
          if (!isset(self::$mapping[$type])) {
              throw new UnknownPacketTypeException(sprintf('Unknown packet type %d.', $type));
          }
  
          $class = self::$mapping[$type];
  
          return new $class();
      }
code_tokens: public function build ( $ type ) { if ( ! isset ( self :: $ mapping [ $ type ] ) ) { throw new UnknownPacketTypeException ( sprintf ( 'Unknown packet type %d.' , $ type ) ) ; } $ class = self :: $ mapping [ $ type ] ; return new $ class ( ) ; }
docstring: Builds a packet object for the given type.
  
  @param int $type
  
  @throws UnknownPacketTypeException
  
  @return Packet
docstring_tokens: Builds a packet object for the given type .