protected function pickNode() { $nodes = $this->getNodes(); $index = mt_rand(0, count($nodes) - 1); return array_keys($nodes)[$index]; }