original_string: private function applyAttribs(Tokens $tokens, $index, array $attribs)
      {
          $toInsert = [];
  
          foreach ($attribs as $attrib) {
              if (null !== $attrib && '' !== $attrib->getContent()) {
                  $toInsert[] = $attrib;
                  $toInsert[] = new Token([T_WHITESPACE, ' ']);
              }
          }
  
          if (!empty($toInsert)) {
              $tokens->insertAt($index, $toInsert);
          }
      }
code: private function applyAttribs(Tokens $tokens, $index, array $attribs)
      {
          $toInsert = [];
  
          foreach ($attribs as $attrib) {
              if (null !== $attrib && '' !== $attrib->getContent()) {
                  $toInsert[] = $attrib;
                  $toInsert[] = new Token([T_WHITESPACE, ' ']);
              }
          }
  
          if (!empty($toInsert)) {
              $tokens->insertAt($index, $toInsert);
          }
      }
code_tokens: private function applyAttribs ( Tokens $ tokens , $ index , array $ attribs ) { $ toInsert = [ ] ; foreach ( $ attribs as $ attrib ) { if ( null !== $ attrib && '' !== $ attrib -> getContent ( ) ) { $ toInsert [ ] = $ attrib ; $ toInsert [ ] = new Token ( [ T_WHITESPACE , ' ' ] ) ; } } if ( ! empty ( $ toInsert ) ) { $ tokens -> insertAt ( $ index , $ toInsert ) ; } }
docstring: Apply token attributes.
  
  Token at given index is prepended by attributes.
  
  @param Tokens $tokens  Tokens collection
  @param int    $index   token index
  @param array  $attribs array of token attributes
docstring_tokens: Apply token attributes .