![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/mautic.corals.io/vendor/knplabs/knp-menu/src/Knp/Menu/Matcher/Voter/ |
<?php namespace Knp\Menu\Matcher\Voter; use Knp\Menu\ItemInterface; /** * Implements the VoterInterface which can be used as voter for "current" class * `matchItem` will return true if the pattern you're searching for is found in the URI of the item */ class RegexVoter implements VoterInterface { public function __construct(private ?string $regexp) { } public function matchItem(ItemInterface $item): ?bool { if (null === $this->regexp || null === $item->getUri()) { return null; } if (\preg_match($this->regexp, $item->getUri())) { return true; } return null; } }