Skip to content
Snippets Groups Projects

Convert code blocks in comments using array() syntax to @code/@endcode

Closed quietone requested to merge issue/drupal-3454142:3454142-convert-code-blocks into 11.x
Files
6
@@ -440,20 +440,24 @@ private function tokenizeFormula($formula) {
* An example of plural formula parting and evaluation:
* Plural formula: 'n!=1'
* This formula is parsed by parseArithmetic() to a stack (array) of elements:
* array(
* @code
* [
* 0 => '$n',
* 1 => '1',
* 2 => '!=',
* );
* ];
* @endcode
* The evaluatePlural() method evaluates the $element_stack using the plural
* value $n. Before the actual evaluation, the '$n' in the array is replaced
* by the value of $n.
* For example: $n = 2 results in:
* array(
* @code
* [
* 0 => '2',
* 1 => '1',
* 2 => '!=',
* );
* ]
* @endcode
* The stack is processed until only one element is (the result) is left. In
* every iteration the top elements of the stack, up until the first operator,
* are evaluated. After evaluation the arguments and the operator itself are
@@ -462,9 +466,11 @@ private function tokenizeFormula($formula) {
* Because the operator is '!=' the example stack is evaluated as:
* $f = (int) 2 != 1;
* The resulting stack is:
* array(
* @code
* [
* 0 => 1,
* );
* ]
* @endcode
* With only one element left in the stack (the final result) the loop is
* terminated and the result is returned.
*
Loading