Skip to content

Commit da854b0

Browse files
committed
cfformatting
1 parent 9d7197c commit da854b0

File tree

62 files changed

+521
-1238
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+521
-1238
lines changed

.cfformat.json

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
{
22
"array.empty_padding": false,
33
"array.padding": true,
4-
"array.multiline.min_length": 40,
4+
"array.multiline.min_length": 50,
55
"array.multiline.element_count": 2,
66
"array.multiline.leading_comma.padding": true,
77
"array.multiline.leading_comma": false,
88
"alignment.consecutive.assignments": true,
99
"alignment.consecutive.properties": true,
1010
"alignment.consecutive.params": true,
11+
"alignment.doc_comments" : true,
1112
"brackets.padding": true,
1213
"comment.asterisks": "align",
1314
"binary_operators.padding": true,
@@ -17,22 +18,22 @@
1718
"function_call.multiline.leading_comma.padding": true,
1819
"function_call.casing.builtin": "cfdocs",
1920
"function_call.casing.userdefined": "camel",
20-
"function_call.multiline.element_count": 2,
21+
"function_call.multiline.element_count": 3,
2122
"function_call.multiline.leading_comma": false,
22-
"function_call.multiline.min_length": 40,
23+
"function_call.multiline.min_length": 50,
2324
"function_declaration.padding": true,
2425
"function_declaration.empty_padding": false,
2526
"function_declaration.multiline.leading_comma": false,
2627
"function_declaration.multiline.leading_comma.padding": true,
27-
"function_declaration.multiline.element_count": 2,
28-
"function_declaration.multiline.min_length": 40,
28+
"function_declaration.multiline.element_count": 3,
29+
"function_declaration.multiline.min_length": 50,
2930
"function_declaration.group_to_block_spacing": "compact",
3031
"function_anonymous.empty_padding": false,
3132
"function_anonymous.group_to_block_spacing": "compact",
32-
"function_anonymous.multiline.element_count": 2,
33+
"function_anonymous.multiline.element_count": 3,
3334
"function_anonymous.multiline.leading_comma": false,
3435
"function_anonymous.multiline.leading_comma.padding": true,
35-
"function_anonymous.multiline.min_length": 40,
36+
"function_anonymous.multiline.min_length": 50,
3637
"function_anonymous.padding": true,
3738
"indent_size": 4,
3839
"keywords.block_to_keyword_spacing": "spaced",
@@ -41,13 +42,13 @@
4142
"keywords.spacing_to_block": "spaced",
4243
"keywords.spacing_to_group": true,
4344
"keywords.empty_group_spacing": false,
44-
"max_columns": 120,
45+
"max_columns": 115,
4546
"metadata.multiline.element_count": 3,
46-
"metadata.multiline.min_length": 40,
47+
"metadata.multiline.min_length": 50,
4748
"method_call.chain.multiline" : 3,
4849
"newline":"\n",
4950
"property.multiline.element_count": 3,
50-
"property.multiline.min_length": 40,
51+
"property.multiline.min_length": 30,
5152
"parentheses.padding": true,
5253
"strings.quote": "double",
5354
"strings.attributes.quote": "double",
@@ -57,6 +58,6 @@
5758
"struct.multiline.leading_comma": false,
5859
"struct.multiline.leading_comma.padding": true,
5960
"struct.multiline.element_count": 2,
60-
"struct.multiline.min_length": 40,
61+
"struct.multiline.min_length": 60,
6162
"tab_indent": true
62-
}
63+
}

ModuleConfig.cfc

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,7 @@ component {
4343
// Did you change the validation manager?
4444
if ( variables.settings.manager != this.COLDBOX_VALIDATION_MANAGER ) {
4545
binder
46-
.map(
47-
alias = "validationManager@cbvalidation",
48-
force = true
49-
)
46+
.map( alias = "validationManager@cbvalidation", force = true )
5047
.to( variables.settings.manager )
5148
.asSingleton();
5249
}

changelog.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
----
99

10-
## [3.3.0] => 2021-NOV-12
10+
## [3.3.0] => 2022-JAN-12
11+
12+
### Added
13+
14+
* Allow UDF and Method Validators to Utilize Error Metadata by @homestar9 (https://github.com/coldbox-modules/cbvalidation/pull/48)
1115

1216
### Fixed
1317

1418
* Date Comparisons Fail if Compare field is empty #58 thanks to @nockhigan: https://github.com/coldbox-modules/cbvalidation/pull/58
15-
*
1619

1720
----
1821

@@ -55,7 +58,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
5558
* Two new helpers: `validateIsNullorEmpty()` and `validateHasValue` so you can do simple validations not only on objects and constraints.
5659
* `RequiredIf, RequiredUnless` can now be declared with a simple value pointing to a field. Basically testing if `anotherField` exists, or unless `anotherField` exists.
5760
* New `BaseValidator` for usage by all validators to bring uniformity, global di, and helpers.
58-
61+
5962
### Changed
6063

6164
* The `IValidator` removes the `getName()` since that comes from the `BaseValidator` now.

interfaces/IValidationError.cfc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,28 @@ interface {
99

1010
/**
1111
* Set the error message
12+
*
1213
* @messageThe error message
1314
*/
1415
cbvalidation.interfaces.IValidationError function setMessage( required string message );
1516

1617
/**
1718
* Set the field
19+
*
1820
* @messageThe error message
1921
*/
2022
cbvalidation.interfaces.IValidationError function setField( required string field );
2123

2224
/**
2325
* Set the rejected value
26+
*
2427
* @valueThe rejected value
2528
*/
2629
cbvalidation.interfaces.IValidationError function setRejectedValue( required any value );
2730

2831
/**
2932
* Set the validator type name that rejected
33+
*
3034
* @validationTypeThe name of the rejected validator
3135
*/
3236
cbvalidation.interfaces.IValidationError function setValidationType( required any validationType );
@@ -38,6 +42,7 @@ interface {
3842

3943
/**
4044
* Set the validator data
45+
*
4146
* @dataThe data of the validator
4247
*/
4348
cbvalidation.interfaces.IValidationError function setValidationData( required any data );

interfaces/IValidationManager.cfc

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ interface {
1111
/**
1212
* Validate an object
1313
*
14-
* @targetThe target object to validate
15-
* @fieldsOne or more fields to validate on, by default it validates all fields in the constraints. This can be a simple list or an array.
16-
* @constraintsAn optional shared constraints name or an actual structure of constraints to validate on.
17-
* @localeAn optional locale to use for i18n messages
14+
* @targetThe target object to validate
15+
* @fieldsOne or more fields to validate on, by default it validates all fields in the constraints. This can be a simple list or an array.
16+
* @constraintsAn optional shared constraints name or an actual structure of constraints to validate on.
17+
* @localeAn optional locale to use for i18n messages
1818
* @excludeFieldsAn optional list of fields to exclude from the validation.
1919
* @includeFieldsAn optional list of fields to include in the validation.
2020
*
@@ -55,14 +55,11 @@ interface {
5555
/**
5656
* Store a shared constraint
5757
*
58-
* @nameFilter by name or not
58+
* @nameFilter by name or not
5959
* @constraintThe constraint to store.
6060
*
6161
* @return cbvalidation.interfaces.IValidationManager
6262
*/
63-
any function addSharedConstraint(
64-
required string name,
65-
required struct constraint
66-
);
63+
any function addSharedConstraint( required string name, required struct constraint );
6764

6865
}

interfaces/IValidationResult.cfc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ interface {
99

1010
/**
1111
* Add errors into the result object
12-
* @error The validation error to add into the results object
12+
*
13+
* @error The validation error to add into the results object
1314
* @error_generic cbvalidation.interfaces.IValidationError
1415
*
1516
* @return cbvalidation.interfaces.IValidationResult
@@ -18,6 +19,7 @@ interface {
1819

1920
/**
2021
* Set the validation target object name
22+
*
2123
* @return cbvalidation.interfaces.IValidationResult
2224
*/
2325
any function setTargetName( required string name );
@@ -47,31 +49,36 @@ interface {
4749

4850
/**
4951
* Determine if the results had error or not
52+
*
5053
* @fieldThe field to count on (optional)
5154
*/
5255
boolean function hasErrors( string field );
5356

5457
/**
5558
* Clear All errors
59+
*
5660
* @return cbvalidation.interfaces.IValidationResult
5761
*/
5862
any function clearErrors();
5963

6064

6165
/**
6266
* Get how many errors you have
67+
*
6368
* @fieldThe field to count on (optional)
6469
*/
6570
numeric function getErrorCount( string field );
6671

6772
/**
6873
* Get the Errors Array, which is an array of error messages (strings)
74+
*
6975
* @fieldThe field to use to filter the error messages on (optional)
7076
*/
7177
array function getAllErrors( string field );
7278

7379
/**
7480
* Get an error object for a specific field that failed. Throws exception if the field does not exist
81+
*
7582
* @fieldThe field to return error objects on
7683
*
7784
* @return cbvalidation.interfaces.IValidationError[]

interfaces/IValidator.cfc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ interface {
88

99
/**
1010
* Will check if an incoming value validates
11+
*
1112
* @validationResult The result object of the validation
12-
* @target The target object to validate on
13-
* @field The field on the target object to validate on
14-
* @targetValue The target value to validate
15-
* @rules The rules imposed on the currently validating field
13+
* @target The target object to validate on
14+
* @field The field on the target object to validate on
15+
* @targetValue The target value to validate
16+
* @rules The rules imposed on the currently validating field
1617
*/
1718
boolean function validate(
1819
required any validationResult,

models/GenericObject.cfc

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,11 @@ component {
2727
/**
2828
* Process dynamic getters
2929
*
30-
* @missingMethodName
30+
* @missingMethodName
3131
* @missingMethodArguments
3232
*/
33-
any function onMissingMethod(
34-
required string missingMethodName,
35-
required struct missingMethodArguments
36-
){
37-
var key = replaceNoCase(
38-
arguments.missingMethodName,
39-
"get",
40-
""
41-
);
33+
any function onMissingMethod( required string missingMethodName, required struct missingMethodArguments ){
34+
var key = replaceNoCase( arguments.missingMethodName, "get", "" );
4235

4336
if ( structKeyExists( variables.collection, key ) ) {
4437
return variables.collection[ key ];

0 commit comments

Comments
 (0)