data = $data; } /** * Counts how many items the menu has. * * @return int */ public function count(): int { $htmlItems = $this->data['html-items'] ?? ''; return substr_count( $htmlItems, 'data + [ 'class' => '', 'label' => '', 'html-tooltip' => '', 'label-class' => '', 'heading-class' => '', 'html-before-portal' => '', 'html-items' => '', 'html-after-portal' => '', ]; } }