public static function buildValidation(array $schema, $name = null)
    {
        $validation = new NestedValidation($name);

        foreach ($schema as $key => $value) {

            if (!is_array($value)) {
                trigger_error('parsing error', E_USER_ERROR);
            }

            if (self::isNestedValidation($value)) {
                $validation->addValidation(self::buildValidation($value, $key));
            } else {
                $validation->addValidation(self::buildKeyValidation($value, $key));
            }

        }
        return $validation;
    }
public static function buildValidation(array $schema, $name = null)
    {
        $validation = new NestedValidation($name);

        foreach ($schema as $key => $value) {

            if (!is_array($value)) {
                trigger_error('parsing error', E_USER_ERROR);
            }

            if (self::isNestedValidation($value)) {
                $validation->addValidation(self::buildValidation($value, $key));
            } else {
                $validation->addValidation(self::buildKeyValidation($value, $key));
            }

        }
        return $validation;
    }
public static function buildValidation ( array $ schema , $ name = null ) { $ validation = new NestedValidation ( $ name ) ; foreach ( $ schema as $ key => $ value ) { if ( ! is_array ( $ value ) ) { trigger_error ( 'parsing error' , E_USER_ERROR ) ; } if ( self :: isNestedValidation ( $ value ) ) { $ validation -> addValidation ( self :: buildValidation ( $ value , $ key ) ) ; } else { $ validation -> addValidation ( self :: buildKeyValidation ( $ value , $ key ) ) ; } } return $ validation ; }
This function builds a validation acording to the specifgications of the json file

@param array $schema
@param null $name
@return NestedValidation
This function builds a validation acording to the specifgications of the json file