protected function hasContentForKey($key, $content): bool
    {
        if ($content instanceof Treadable) {
            return $content->hasChildForKey($key);
        }

        if (is_array($content) || $content instanceof \ArrayAccess) {
            return isset($content[$key]);
        }

        if (is_object($content)) {
            return property_exists($content, $key);
        }

        return false;
    }