Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Scanner.php

function Scanner::consumeCommentsForCurrentToken

Consumes comment tokens associated with the current token

Return value

$this

2 calls to Scanner::consumeCommentsForCurrentToken()
Scanner::consumeEnd in vendor/mck89/peast/lib/Peast/Syntax/Scanner.php
Executes the operations to handle the end of the source scanning
Scanner::consumeToken in vendor/mck89/peast/lib/Peast/Syntax/Scanner.php
Consumes the current token

File

vendor/mck89/peast/lib/Peast/Syntax/Scanner.php, line 960

Class

Scanner
Base class for scanners.

Namespace

Peast\Syntax

Code

protected function consumeCommentsForCurrentToken() {
    $comments = $this->commentsForCurrentToken();
    if ($comments && ($this->registerTokens || $this->eventsEmitter)) {
        foreach ($comments as $comment) {
            
            //Register the token if required
            if ($this->registerTokens) {
                $this->tokens[] = $comment;
            }
            
            //Emit the TokenConsumed event for the comment
            $this->eventsEmitter && $this->eventsEmitter
                ->fire("TokenConsumed", array(
                $comment,
            ));
        }
    }
    return $this;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal