original_string: public function changeUserMode(EventInterface $event, EventQueueInterface $queue)
      {
          $logger = $this->getLogger();
  
          $params = $event->getParams();
          $logger->debug('Changing user mode', array('params' => $params));
  
          // Disregard mode changes without both an associated channel and user
          if (!isset($params['channel']) || !isset($params['user'])) {
              $logger->debug('Missing channel or user, skipping');
              return;
          }
  
          $connectionMask = $this->getConnectionMask($event->getConnection());
          $channel = $params['channel'];
          $nick = $params['user'];
          $modes = str_split($params['mode']);
          $operation = array_shift($modes);
  
          $logger->debug('Extracted event data', array(
              'connectionMask' => $connectionMask,
              'channel' => $channel,
              'nick' => $nick,
              'operation' => $operation,
              'modes' => $modes,
          ));
  
          foreach ($modes as $mode) {
              switch ($operation) {
                  case '+':
                      if (!isset($this->modes[$connectionMask])) {
                          $this->modes[$connectionMask] = array();
                      }
                      if (!isset($this->modes[$connectionMask][$channel])) {
                          $this->modes[$connectionMask][$channel] = array();
                      }
                      if (!isset($this->modes[$connectionMask][$channel][$nick])) {
                          $this->modes[$connectionMask][$channel][$nick] = array();
                      }
                      $this->modes[$connectionMask][$channel][$nick][$mode] = true;
                      break;
                  case '-':
                      unset($this->modes[$connectionMask][$channel][$nick][$mode]);
                      break;
                  default:
                      $logger->warning('Encountered unknown operation', array(
                          'operation' => $operation,
                      ));
                      break;
              }
          }
      }
code: public function changeUserMode(EventInterface $event, EventQueueInterface $queue)
      {
          $logger = $this->getLogger();
  
          $params = $event->getParams();
          $logger->debug('Changing user mode', array('params' => $params));
  
          // Disregard mode changes without both an associated channel and user
          if (!isset($params['channel']) || !isset($params['user'])) {
              $logger->debug('Missing channel or user, skipping');
              return;
          }
  
          $connectionMask = $this->getConnectionMask($event->getConnection());
          $channel = $params['channel'];
          $nick = $params['user'];
          $modes = str_split($params['mode']);
          $operation = array_shift($modes);
  
          $logger->debug('Extracted event data', array(
              'connectionMask' => $connectionMask,
              'channel' => $channel,
              'nick' => $nick,
              'operation' => $operation,
              'modes' => $modes,
          ));
  
          foreach ($modes as $mode) {
              switch ($operation) {
                  case '+':
                      if (!isset($this->modes[$connectionMask])) {
                          $this->modes[$connectionMask] = array();
                      }
                      if (!isset($this->modes[$connectionMask][$channel])) {
                          $this->modes[$connectionMask][$channel] = array();
                      }
                      if (!isset($this->modes[$connectionMask][$channel][$nick])) {
                          $this->modes[$connectionMask][$channel][$nick] = array();
                      }
                      $this->modes[$connectionMask][$channel][$nick][$mode] = true;
                      break;
                  case '-':
                      unset($this->modes[$connectionMask][$channel][$nick][$mode]);
                      break;
                  default:
                      $logger->warning('Encountered unknown operation', array(
                          'operation' => $operation,
                      ));
                      break;
              }
          }
      }
code_tokens: public function changeUserMode ( EventInterface $ event , EventQueueInterface $ queue ) { $ logger = $ this -> getLogger ( ) ; $ params = $ event -> getParams ( ) ; $ logger -> debug ( 'Changing user mode' , array ( 'params' => $ params ) ) ; // Disregard mode changes without both an associated channel and user if ( ! isset ( $ params [ 'channel' ] ) || ! isset ( $ params [ 'user' ] ) ) { $ logger -> debug ( 'Missing channel or user, skipping' ) ; return ; } $ connectionMask = $ this -> getConnectionMask ( $ event -> getConnection ( ) ) ; $ channel = $ params [ 'channel' ] ; $ nick = $ params [ 'user' ] ; $ modes = str_split ( $ params [ 'mode' ] ) ; $ operation = array_shift ( $ modes ) ; $ logger -> debug ( 'Extracted event data' , array ( 'connectionMask' => $ connectionMask , 'channel' => $ channel , 'nick' => $ nick , 'operation' => $ operation , 'modes' => $ modes , ) ) ; foreach ( $ modes as $ mode ) { switch ( $ operation ) { case '+' : if ( ! isset ( $ this -> modes [ $ connectionMask ] ) ) { $ this -> modes [ $ connectionMask ] = array ( ) ; } if ( ! isset ( $ this -> modes [ $ connectionMask ] [ $ channel ] ) ) { $ this -> modes [ $ connectionMask ] [ $ channel ] = array ( ) ; } if ( ! isset ( $ this -> modes [ $ connectionMask ] [ $ channel ] [ $ nick ] ) ) { $ this -> modes [ $ connectionMask ] [ $ channel ] [ $ nick ] = array ( ) ; } $ this -> modes [ $ connectionMask ] [ $ channel ] [ $ nick ] [ $ mode ] = true ; break ; case '-' : unset ( $ this -> modes [ $ connectionMask ] [ $ channel ] [ $ nick ] [ $ mode ] ) ; break ; default : $ logger -> warning ( 'Encountered unknown operation' , array ( 'operation' => $ operation , ) ) ; break ; } } }
docstring: Monitors use mode changes.
  
  @param \Phergie\Irc\Event\EventInterface $event
  @param \Phergie\Irc\Bot\React\EventQueueInterface $queue
docstring_tokens: Monitors use mode changes .