src/Jms/YamlValidatorConverter.php
public function getTypes()
    {
        $classes = parent::getTypes();

        foreach ($classes as $k => &$definition) {

            if (empty($definition[$k]['properties'])) {
                unset($classes[$k]);
                continue;
            }

            $properties = array_filter(array_map(function ($property) {

                if (!empty($property['validation'])) {


                    foreach ($property['validation'] as &$rule){
                        foreach ($rule as $type => &$item) {

                            if ($type === 'Valid') {
                                continue;
                            } else {
                                if (!is_array($item)){
                                    $item = [];
                                }
                                $item['groups'] = ['xsd_rules'];
                            }

                        }
                        unset($item);
                    }
                    unset($rule);

                    return $property['validation'];
                }


                return null;
            }, $definition[$k]['properties']));

            if (empty($properties)) {
                unset($classes[$k]);
                continue;
            }

            $definition[$k] = [
                'properties' => $properties
            ];
        }

        return $classes;
    }
public function getTypes()
    {
        $classes = parent::getTypes();

        foreach ($classes as $k => &$definition) {

            if (empty($definition[$k]['properties'])) {
                unset($classes[$k]);
                continue;
            }

            $properties = array_filter(array_map(function ($property) {

                if (!empty($property['validation'])) {


                    foreach ($property['validation'] as &$rule){
                        foreach ($rule as $type => &$item) {

                            if ($type === 'Valid') {
                                continue;
                            } else {
                                if (!is_array($item)){
                                    $item = [];
                                }
                                $item['groups'] = ['xsd_rules'];
                            }

                        }
                        unset($item);
                    }
                    unset($rule);

                    return $property['validation'];
                }


                return null;
            }, $definition[$k]['properties']));

            if (empty($properties)) {
                unset($classes[$k]);
                continue;
            }

            $definition[$k] = [
                'properties' => $properties
            ];
        }

        return $classes;
    }
public function getTypes ( ) { $ classes = parent :: getTypes ( ) ; foreach ( $ classes as $ k => & $ definition ) { if ( empty ( $ definition [ $ k ] [ 'properties' ] ) ) { unset ( $ classes [ $ k ] ) ; continue ; } $ properties = array_filter ( array_map ( function ( $ property ) { if ( ! empty ( $ property [ 'validation' ] ) ) { foreach ( $ property [ 'validation' ] as & $ rule ) { foreach ( $ rule as $ type => & $ item ) { if ( $ type === 'Valid' ) { continue ; } else { if ( ! is_array ( $ item ) ) { $ item = [ ] ; } $ item [ 'groups' ] = [ 'xsd_rules' ] ; } } unset ( $ item ) ; } unset ( $ rule ) ; return $ property [ 'validation' ] ; } return null ; } , $ definition [ $ k ] [ 'properties' ] ) ) ; if ( empty ( $ properties ) ) { unset ( $ classes [ $ k ] ) ; continue ; } $ definition [ $ k ] = [ 'properties' => $ properties ] ; } return $ classes ; }
Clean the properties for only remaining valid rules for Symfony Validation Constraints

@return PHPClass[]
Clean the properties for only remaining valid rules for Symfony Validation Constraints