original_string: public function addCommand($aAttributes, $mData)
      {
          /* merge commands if possible */
          if(in_array($aAttributes['cmd'], array('js', 'ap')))
          {
              if(($aLastCommand = array_pop($this->aCommands)))
              {
                  if($aLastCommand['cmd'] == $aAttributes['cmd'])
                  {
                      if($this->getOption('core.response.merge.js') &&
                              $aLastCommand['cmd'] == 'js')
                      {
                          $mData = $aLastCommand['data'].'; '.$mData;
                      }
                      elseif($this->getOption('core.response.merge.ap') &&
                              $aLastCommand['cmd'] == 'ap' &&
                              $aLastCommand['id'] == $aAttributes['id'] &&
                              $aLastCommand['prop'] == $aAttributes['prop'])
                      {
                          $mData = $aLastCommand['data'].' '.$mData;
                      }
                      else
                      {
                          $this->aCommands[] = $aLastCommand;
                      }
                  }
                  else
                  {
                      $this->aCommands[] = $aLastCommand;
                  }
              }
          }
          $aAttributes['data'] = $mData;
          $this->aCommands[] = $aAttributes;
  
          return $this;
      }
code: public function addCommand($aAttributes, $mData)
      {
          /* merge commands if possible */
          if(in_array($aAttributes['cmd'], array('js', 'ap')))
          {
              if(($aLastCommand = array_pop($this->aCommands)))
              {
                  if($aLastCommand['cmd'] == $aAttributes['cmd'])
                  {
                      if($this->getOption('core.response.merge.js') &&
                              $aLastCommand['cmd'] == 'js')
                      {
                          $mData = $aLastCommand['data'].'; '.$mData;
                      }
                      elseif($this->getOption('core.response.merge.ap') &&
                              $aLastCommand['cmd'] == 'ap' &&
                              $aLastCommand['id'] == $aAttributes['id'] &&
                              $aLastCommand['prop'] == $aAttributes['prop'])
                      {
                          $mData = $aLastCommand['data'].' '.$mData;
                      }
                      else
                      {
                          $this->aCommands[] = $aLastCommand;
                      }
                  }
                  else
                  {
                      $this->aCommands[] = $aLastCommand;
                  }
              }
          }
          $aAttributes['data'] = $mData;
          $this->aCommands[] = $aAttributes;
  
          return $this;
      }
code_tokens: public function addCommand ( $ aAttributes , $ mData ) { /* merge commands if possible */ if ( in_array ( $ aAttributes [ 'cmd' ] , array ( 'js' , 'ap' ) ) ) { if ( ( $ aLastCommand = array_pop ( $ this -> aCommands ) ) ) { if ( $ aLastCommand [ 'cmd' ] == $ aAttributes [ 'cmd' ] ) { if ( $ this -> getOption ( 'core.response.merge.js' ) && $ aLastCommand [ 'cmd' ] == 'js' ) { $ mData = $ aLastCommand [ 'data' ] . '; ' . $ mData ; } elseif ( $ this -> getOption ( 'core.response.merge.ap' ) && $ aLastCommand [ 'cmd' ] == 'ap' && $ aLastCommand [ 'id' ] == $ aAttributes [ 'id' ] && $ aLastCommand [ 'prop' ] == $ aAttributes [ 'prop' ] ) { $ mData = $ aLastCommand [ 'data' ] . ' ' . $ mData ; } else { $ this -> aCommands [ ] = $ aLastCommand ; } } else { $ this -> aCommands [ ] = $ aLastCommand ; } } } $ aAttributes [ 'data' ] = $ mData ; $ this -> aCommands [ ] = $ aAttributes ; return $ this ; }
docstring: Add a response command to the array of commands that will be sent to the browser
  
  @param array         $aAttributes        Associative array of attributes that will describe the command
  @param mixed            $mData                The data to be associated with this command
  
  @return \Jaxon\Plugin\Response
docstring_tokens: Add a response command to the array of commands that will be sent to the browser