Neos\Flow\Mvc\Routing\Route::compareAndRemoveMatchingDefaultValues PHP Method

compareAndRemoveMatchingDefaultValues() protected method

If a route value is equal to a default value, it's removed from $routeValues. If a value exists but is not equal to is corresponding default, iteration is interrupted and FALSE is returned.
protected compareAndRemoveMatchingDefaultValues ( array $defaults, array &$routeValues ) : boolean
$defaults array
$routeValues array
return boolean FALSE if one of the $routeValues is not equal to it's default value. Otherwise TRUE
    protected function compareAndRemoveMatchingDefaultValues(array $defaults, array &$routeValues)
    {
        foreach ($defaults as $key => $defaultValue) {
            if (!isset($routeValues[$key])) {
                if ($defaultValue === '' || $key === '@format' && strtolower($defaultValue) === 'html') {
                    continue;
                }
                return false;
            }
            if (is_array($defaultValue)) {
                if (!is_array($routeValues[$key])) {
                    return false;
                }
                if ($this->compareAndRemoveMatchingDefaultValues($defaultValue, $routeValues[$key]) === false) {
                    return false;
                }
                continue;
            } elseif (is_array($routeValues[$key])) {
                return false;
            }
            if (strtolower($routeValues[$key]) !== strtolower($defaultValue)) {
                return false;
            }
            unset($routeValues[$key]);
        }
        return true;
    }