public function validate($subject): bool
    {
        if (\is_array($this->schema['patternProperties'])) {
            foreach ($this->schema['patternProperties'] as $pattern => $patternSchema) {
                foreach ($subject as $propertyName => $propertyData) {
                    if (\preg_match(sprintf('/%s/', $pattern), $propertyName)) {
                        $nodeValidator = new NodeValidator($patternSchema, $this->rootSchema);
                        if (!$nodeValidator->validate($propertyData)) {
                            return false;
                        }
                    }
                }
            }
        }
        return true;
    }