for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types = 1);
namespace Everlution\Navigation\Voter;
/**
* Class MatchVoter.
* @author Ivan Barlog <[email protected]>
*/
abstract class MatchVoter implements Voter
{
* @param string $haystack
* @param Matchable $item
* @return bool
public function match(string $haystack, Matchable &$item): bool
foreach ($item->getMatches() as $match) {
if (null !== ($needle = $match->accept($this))) {
return $this->matches($haystack, $needle);
}
return false;
* @param string $needle
abstract protected function matches(string $haystack, string $needle): bool;