Documentation

PHP_CodeSniffer_Tokenizers_Comment
in package

Tokenizes doc block comments.

Tags
category

PHP

author

Greg Sherwood gsherwood@squiz.net

copyright

2006-2012 Squiz Pty Ltd (ABN 77 084 670 600)

license

https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence

version

Release: @package_version@

link
http://pear.php.net/package/PHP_CodeSniffer

Table of Contents

tokenizeString()  : array<string|int, mixed>
Creates an array of tokens when given some PHP code.
_collectWhitespace()  : array<string|int, mixed>|null
Collect consecutive whitespace into a single token.
_processLine()  : array<string|int, mixed>
Process a single line of a comment.

Methods

tokenizeString()

Creates an array of tokens when given some PHP code.

public tokenizeString(string $string, string $eolChar, int $stackPtr) : array<string|int, mixed>

Starts by using token_get_all() but does a lot of extra processing to insert information about the context of the token.

Parameters
$string : string

The string to tokenize.

$eolChar : string

The EOL character to use for splitting strings.

$stackPtr : int

The position of the first token in the file.

Return values
array<string|int, mixed>

_collectWhitespace()

Collect consecutive whitespace into a single token.

private _collectWhitespace(string $string, int $start, int $end) : array<string|int, mixed>|null
Parameters
$string : string

The comment string being tokenized.

$start : int

The position in the string to start processing.

$end : int

The position in the string to end processing.

Return values
array<string|int, mixed>|null

_processLine()

Process a single line of a comment.

private _processLine(string $string, string $eolChar, int $start, int $end) : array<string|int, mixed>
Parameters
$string : string

The comment string being tokenized.

$eolChar : string

The EOL character to use for splitting strings.

$start : int

The position in the string to start processing.

$end : int

The position in the string to end processing.

Return values
array<string|int, mixed>

Search results