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

Breadcrumb

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

function Scanner::adjustColumnAndLine

Increases columns and lines count according to the given string

Parameters

string $buffer String to analyze:

Return value

void

2 calls to Scanner::adjustColumnAndLine()
Scanner::consumeUntil in vendor/mck89/peast/lib/Peast/Syntax/Scanner.php
Consumes characters until one of the given characters is found
Scanner::skipWhitespacesAndComments in vendor/mck89/peast/lib/Peast/Syntax/Scanner.php
Skips whitespaces and comments from the current scan position. If comments handling is enabled, the array of parsed comments

File

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

Class

Scanner
Base class for scanners.

Namespace

Peast\Syntax

Code

protected function adjustColumnAndLine($buffer) {
    $lines = preg_split($this->linesSplitter, $buffer);
    $linesCount = count($lines) - 1;
    $this->line += $linesCount;
    $columns = mb_strlen($lines[$linesCount], "UTF-8");
    if ($linesCount) {
        $this->column = $columns;
    }
    else {
        $this->column += $columns;
    }
}

API Navigation

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