original_string: public function loadUserModes(EventInterface $event, EventQueueInterface $queue)
      {
          $logger = $this->getLogger();
  
          $connectionMask = $this->getConnectionMask($event->getConnection());
          $params = $event->getParams();
          $channel = $params[1];
          $validPrefixes = implode('', array_keys($this->prefixes));
          $pattern = '/^([' . preg_quote($validPrefixes) . ']+)(.+)$/';
          $logger->debug('Gathering initial user mode data', array(
              'connectionMask' => $connectionMask,
              'channel' => $channel,
          ));
  
          foreach ($params['iterable'] as $fullNick) {
              if (!preg_match($pattern, $fullNick, $match)) {
                  continue;
              }
              $nickPrefixes = str_split($match[1]);
              $nick = $match[2];
              foreach ($nickPrefixes as $prefix) {
                  $mode = $this->prefixes[$prefix];
                  $logger->debug('Recording user mode', array(
                      'connectionMask' => $connectionMask,
                      'channel' => $channel,
                      'nick' => $nick,
                      'mode' => $mode,
                  ));
                  $this->modes[$connectionMask][$channel][$nick][$mode] = true;
              }
          }
      }
code: public function loadUserModes(EventInterface $event, EventQueueInterface $queue)
      {
          $logger = $this->getLogger();
  
          $connectionMask = $this->getConnectionMask($event->getConnection());
          $params = $event->getParams();
          $channel = $params[1];
          $validPrefixes = implode('', array_keys($this->prefixes));
          $pattern = '/^([' . preg_quote($validPrefixes) . ']+)(.+)$/';
          $logger->debug('Gathering initial user mode data', array(
              'connectionMask' => $connectionMask,
              'channel' => $channel,
          ));
  
          foreach ($params['iterable'] as $fullNick) {
              if (!preg_match($pattern, $fullNick, $match)) {
                  continue;
              }
              $nickPrefixes = str_split($match[1]);
              $nick = $match[2];
              foreach ($nickPrefixes as $prefix) {
                  $mode = $this->prefixes[$prefix];
                  $logger->debug('Recording user mode', array(
                      'connectionMask' => $connectionMask,
                      'channel' => $channel,
                      'nick' => $nick,
                      'mode' => $mode,
                  ));
                  $this->modes[$connectionMask][$channel][$nick][$mode] = true;
              }
          }
      }
code_tokens: public function loadUserModes ( EventInterface $ event , EventQueueInterface $ queue ) { $ logger = $ this -> getLogger ( ) ; $ connectionMask = $ this -> getConnectionMask ( $ event -> getConnection ( ) ) ; $ params = $ event -> getParams ( ) ; $ channel = $ params [ 1 ] ; $ validPrefixes = implode ( '' , array_keys ( $ this -> prefixes ) ) ; $ pattern = '/^([' . preg_quote ( $ validPrefixes ) . ']+)(.+)$/' ; $ logger -> debug ( 'Gathering initial user mode data' , array ( 'connectionMask' => $ connectionMask , 'channel' => $ channel , ) ) ; foreach ( $ params [ 'iterable' ] as $ fullNick ) { if ( ! preg_match ( $ pattern , $ fullNick , $ match ) ) { continue ; } $ nickPrefixes = str_split ( $ match [ 1 ] ) ; $ nick = $ match [ 2 ] ; foreach ( $ nickPrefixes as $ prefix ) { $ mode = $ this -> prefixes [ $ prefix ] ; $ logger -> debug ( 'Recording user mode' , array ( 'connectionMask' => $ connectionMask , 'channel' => $ channel , 'nick' => $ nick , 'mode' => $ mode , ) ) ; $ this -> modes [ $ connectionMask ] [ $ channel ] [ $ nick ] [ $ mode ] = true ; } } }
docstring: Loads initial user mode data when the bot joins a channel.
  
  @param \Phergie\Irc\Event\EventInterface $event
  @param \Phergie\Irc\Bot\React\EventQueueInterface $queue
docstring_tokens: Loads initial user mode data when the bot joins a channel .