src/Graviton/GeneratorBundle/Definition/Utils/ConstraintNormalizer.php
public static function normalize(Constraint $constraint)
    {
        return [
            'name'      => $constraint->getName(),
            'options'   => array_map(
                function (ConstraintOption $option) {
                    return [
                        'name'  => $option->getName(),
                        'value' => $option->getValue(),
                    ];
                },
                $constraint->getOptions()
            ),
        ];
    }
public static function normalize(Constraint $constraint)
    {
        return [
            'name'      => $constraint->getName(),
            'options'   => array_map(
                function (ConstraintOption $option) {
                    return [
                        'name'  => $option->getName(),
                        'value' => $option->getValue(),
                    ];
                },
                $constraint->getOptions()
            ),
        ];
    }
public static function normalize ( Constraint $ constraint ) { return [ 'name' => $ constraint -> getName ( ) , 'options' => array_map ( function ( ConstraintOption $ option ) { return [ 'name' => $ option -> getName ( ) , 'value' => $ option -> getValue ( ) , ] ; } , $ constraint -> getOptions ( ) ) , ] ; }
Convert constraint to array to selerialile it via json_encode

@param Constraint $constraint Constraint
@return array
Convert constraint to array to selerialile it via json_encode