You are here

function _potx_is_beginning_of_array in Translation template extractor 8

Same name and namespace in other branches
  1. 7.3 potx.inc \_potx_is_beginning_of_array()

Determines if processing an array.

Parameters

string|string[] $arr: The first token.

string|null $par: The next token.

Return value

int|false The number to forward the current position forward to start processing the array. FALSE if not processing an array.

1 call to _potx_is_beginning_of_array()
_potx_find_context in ./potx.inc
Helper to find the value for 'context' on t() and format_plural().

File

./potx.inc, line 1532
Extraction API used by the web and command line interface.

Code

function _potx_is_beginning_of_array($arr, $par) {
  if ($arr === '[' && is_array($par)) {
    return 2;
  }
  if (is_array($arr) && $arr[1] == 'array' && $par == '(') {
    return 3;
  }
  return FALSE;
}