private function processData($target, array $rules, $required, &$result)
    {
        foreach ($rules as $constraintName => $options) {
            // Step first: Build constraint instance 
            if (isset($options['value'])) {

                // When an array is provided then we should merge values and dynamically call a method
                if (is_array($options['value'])) {

                    // Quick trick
                    $args = array_merge(array($constraintName), $options['value']);

                    $constraint = call_user_func_array(array($this->constraintFactory, 'build'), $args);

                } else {
                    $constraint = $this->constraintFactory->build($constraintName, $options['value']);
                }

            } else {

                $constraint = $this->constraintFactory->build($constraintName);
            }

            // Start tweaking the instance
            if (isset($options['break'])) {
                $constraint->setBreakable($options['break']);
            } else {
                // By default it should break the chain
                $constraint->setBreakable(true);
            }

            // If additional message specified, then use it
            // Otherwise a default constraint message is used by default
            if (isset($options['message'])) {
                $constraint->setMessage($options['message']);
            }

            $constraint->setRequired((bool) $required);

            // If a $target name was not provided before
            if (!isset($result[$target])) {
                $result[$target] = array();
            }

            // Finally add prepared constraint
            array_push($result[$target], $constraint);
        }
    }
private function processData($target, array $rules, $required, &$result)
    {
        foreach ($rules as $constraintName => $options) {
            // Step first: Build constraint instance 
            if (isset($options['value'])) {

                // When an array is provided then we should merge values and dynamically call a method
                if (is_array($options['value'])) {

                    // Quick trick
                    $args = array_merge(array($constraintName), $options['value']);

                    $constraint = call_user_func_array(array($this->constraintFactory, 'build'), $args);

                } else {
                    $constraint = $this->constraintFactory->build($constraintName, $options['value']);
                }

            } else {

                $constraint = $this->constraintFactory->build($constraintName);
            }

            // Start tweaking the instance
            if (isset($options['break'])) {
                $constraint->setBreakable($options['break']);
            } else {
                // By default it should break the chain
                $constraint->setBreakable(true);
            }

            // If additional message specified, then use it
            // Otherwise a default constraint message is used by default
            if (isset($options['message'])) {
                $constraint->setMessage($options['message']);
            }

            $constraint->setRequired((bool) $required);

            // If a $target name was not provided before
            if (!isset($result[$target])) {
                $result[$target] = array();
            }

            // Finally add prepared constraint
            array_push($result[$target], $constraint);
        }
    }
private function processData ( $ target , array $ rules , $ required , & $ result ) { foreach ( $ rules as $ constraintName => $ options ) { // Step first: Build constraint instance  if ( isset ( $ options [ 'value' ] ) ) { // When an array is provided then we should merge values and dynamically call a method if ( is_array ( $ options [ 'value' ] ) ) { // Quick trick $ args = array_merge ( array ( $ constraintName ) , $ options [ 'value' ] ) ; $ constraint = call_user_func_array ( array ( $ this -> constraintFactory , 'build' ) , $ args ) ; } else { $ constraint = $ this -> constraintFactory -> build ( $ constraintName , $ options [ 'value' ] ) ; } } else { $ constraint = $ this -> constraintFactory -> build ( $ constraintName ) ; } // Start tweaking the instance if ( isset ( $ options [ 'break' ] ) ) { $ constraint -> setBreakable ( $ options [ 'break' ] ) ; } else { // By default it should break the chain $ constraint -> setBreakable ( true ) ; } // If additional message specified, then use it // Otherwise a default constraint message is used by default if ( isset ( $ options [ 'message' ] ) ) { $ constraint -> setMessage ( $ options [ 'message' ] ) ; } $ constraint -> setRequired ( ( bool ) $ required ) ; // If a $target name was not provided before if ( ! isset ( $ result [ $ target ] ) ) { $ result [ $ target ] = array ( ) ; } // Finally add prepared constraint array_push ( $ result [ $ target ] , $ constraint ) ; } }
Process an array of configuration

@param string $target
@param array $rules
@param boolean $required
@param mixed $result
@return void
Process an array of configuration