Coduo\PHPMatcher\Matcher\ArrayMatcher::valueExist PHP Method

valueExist() private method

private valueExist ( $path, array $haystack ) : boolean
$path
$haystack array
return boolean
    private function valueExist($path, array $haystack)
    {
        $propertyPath = new PropertyPath($path);
        $length = $propertyPath->getLength();
        $valueExist = true;
        for ($i = 0; $i < $length; ++$i) {
            $property = $propertyPath->getElement($i);
            $isIndex = $propertyPath->isIndex($i);
            $propertyExist = $this->arrayPropertyExists($property, $haystack);
            if ($isIndex && !$propertyExist) {
                $valueExist = false;
                break;
            }
        }
        unset($propertyPath);
        return $valueExist;
    }