code: public function getArrayEnd($index)
      {
          $level = 1;
          for (++$index, $max = \count($this); $index < $max; ++$index) {
              if ($this[$index]->isType(DocLexer::T_OPEN_CURLY_BRACES)) {
                  ++$level;
              } elseif ($this[$index]->isType($index, DocLexer::T_CLOSE_CURLY_BRACES)) {
                  --$level;
              }
  
              if (0 === $level) {
                  return $index;
              }
          }
  
          return null;
      }
docs: Returns the index of the close brace that matches the open brace at the given index.
  
  @param int $index
  
  @return null|int