private function validateSchemaDependencies(array $subject, string $propertyName, array $dependencySchema): bool
    {
        if (\is_string($propertyName) && \is_array($dependencySchema)) {
            if (\array_key_exists($propertyName, $subject)) {
                // set 'type': 'object' in dependency schema to make sure it will be validated with ObjectValidator
                $dependencySchema['type'] = 'object';
                $nodeValidator = new NodeValidator($dependencySchema, $this->rootSchema);
                if (!$nodeValidator->validate($subject)) {
                    return false;
                }
            }
        }
        return true;
    }