for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Everlution\Navigation\Match\Voter;
use Everlution\Navigation\Match\MatchInterface;
use Everlution\Navigation\Match\VoterInterface;
/**
* Class RegexMatchVoter.
*
* @author Ivan Barlog <[email protected]>
*/
class RegexMatchVoter implements VoterInterface
{
public function matches(string $url, MatchInterface $match): bool
if (false === $match instanceof RegexMatch) {
return false;
}
return 1 === preg_match($match->getValue(), $url);