code: private function retrieveCurrentItem(ItemInterface $item)
      {
          if ($this->matcher->isCurrent($item)) {
              return $item;
          }
  
          if ($this->matcher->isAncestor($item)) {
              foreach ($item->getChildren() as $child) {
                  $currentItem = $this->retrieveCurrentItem($child);
  
                  if (null !== $currentItem) {
                      return $currentItem;
                  }
              }
          }
  
          return null;
      }
docs: @param ItemInterface $item
  
  @return ItemInterface|null