public function isAncestor(ItemInterface $item, $depth = null): bool
    {
        $request = $this->request_stack->getCurrentRequest();

        return 0 === strpos($request->getPathInfo(), $item->getUri());
    }
public function isAncestor(ItemInterface $item, $depth = null): bool
    {
        $request = $this->request_stack->getCurrentRequest();

        return 0 === strpos($request->getPathInfo(), $item->getUri());
    }
public function isAncestor ( ItemInterface $ item , $ depth = null ) : bool { $ request = $ this -> request_stack -> getCurrentRequest ( ) ; return 0 === strpos ( $ request -> getPathInfo ( ) , $ item -> getUri ( ) ) ; }
Overrides parent isAncestor to determine based on path.

@param ItemInterface $item  The item to check.
@param mixed         $depth The depth to search.

@return bool
Overrides parent isAncestor to determine based on path .