You appear to be a bot. Output may be restricted
Description
Determine the end line numberWhen we come across a right curly brace the PHP token doesn't contain the line number. We look for the previous token with a line number and add the number of line feeds in the token's content to its line number to determine the end line of the right curly brace. Note: We don't expect any more code after the right curly brace that ends the function.
Usage
$int = _oiksc_get_endline( $tokens, $t );
Parameters
- $tokens
- ( array ) required – array of tokens
- $t
- ( int ) required – the index of the final curly brace
Returns
int the calculated end line numberSource
File name: oik-shortcodes/classes/oik-listapis2.phpLines:
1 to 11 of 11
function _oiksc_get_endline( $tokens, $t ) { $endline = null; while ( !is_array( $tokens[$t] ) ) { $t--; } $endline = $tokens[$t][2]; $newlines = substr_count( $tokens[$t][1], "\n" ); $endline += $newlines; //+ $crs; //echo "this thing ends at line $endline" . PHP_EOL; return( $endline ); }View on GitHub