protected function bind($vars, ServerRequestInterface $request, array $parts)
    {
        $type = is_array($vars) && array_keys($vars) === array_keys(array_keys($vars)) ? 'numeric' : 'assoc';

        $values = $this->bindParts($vars, $type, $request, $parts);

        if ($vars instanceof Route) {
            $class = get_class($vars);
            $values = new $class($values);
        } elseif (is_object($vars) && $type === 'assoc') {
            $values = (object)$values;
        }
        
        return $values;
    }