src/Validators/ObjectValidators/AdditionalPropertiesValidator.php
private function removePatternPropertiesFromSubject(array $subject, array $schema): array
    {
        if (isset($schema['patternProperties']) && \is_array($schema['patternProperties'])) {
            $patterns = \array_keys($schema['patternProperties']);
            $propertyNames = \array_keys($subject);

            foreach ($patterns as $pattern) {
                foreach ($propertyNames as $propertyName) {
                    if (\preg_match(sprintf('/%s/', $pattern), $propertyName)) {
                        unset($subject[$propertyName]);
                    }
                }
            }
        }
        return $subject;
    }
private function removePatternPropertiesFromSubject(array $subject, array $schema): array
    {
        if (isset($schema['patternProperties']) && \is_array($schema['patternProperties'])) {
            $patterns = \array_keys($schema['patternProperties']);
            $propertyNames = \array_keys($subject);

            foreach ($patterns as $pattern) {
                foreach ($propertyNames as $propertyName) {
                    if (\preg_match(sprintf('/%s/', $pattern), $propertyName)) {
                        unset($subject[$propertyName]);
                    }
                }
            }
        }
        return $subject;
    }
private function removePatternPropertiesFromSubject ( array $ subject , array $ schema ) : array { if ( isset ( $ schema [ 'patternProperties' ] ) && \ is_array ( $ schema [ 'patternProperties' ] ) ) { $ patterns = \ array_keys ( $ schema [ 'patternProperties' ] ) ; $ propertyNames = \ array_keys ( $ subject ) ; foreach ( $ patterns as $ pattern ) { foreach ( $ propertyNames as $ propertyName ) { if ( \ preg_match ( sprintf ( '/%s/' , $ pattern ) , $ propertyName ) ) { unset ( $ subject [ $ propertyName ] ) ; } } } } return $ subject ; }
Removes properties defined in 'patternProperties' from subject

@param array $subject
@param array $schema
@return array
Removes properties defined in patternProperties from subject