Skip to content

Commit f9e4b72

Browse files
committed
* Improvements : Consistency on all validators to ignore null or empty values except the Required validator
* `Improvements` : Formatting consistencies * `Improvements` : Improve error messages to describe better validation * `Improvements` : Get away from `evaluate()` instead use `invoke()` * `Bugs` : Fixed lots of wrong type exceptions * `Compat` : Remove ACF11 support
1 parent 9f474d2 commit f9e4b72

Some content is hidden

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

42 files changed

+1758
-1037
lines changed

.cfformat.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"function_call.padding": true,
1717
"function_call.multiline.leading_comma.padding": true,
1818
"function_call.casing.builtin": "cfdocs",
19-
"function_call.casing.userdefined": "",
19+
"function_call.casing.userdefined": "camel",
2020
"function_call.multiline.element_count": 4,
2121
"function_call.multiline.leading_comma": false,
2222
"function_call.multiline.min_length": 40,

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ env:
1010
- MODULE_ID=cbvalidation
1111
matrix:
1212
- ENGINE=lucee@5
13-
- ENGINE=adobe@11
1413
- ENGINE=adobe@2016
1514
- ENGINE=adobe@2018
1615

box.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name":"ColdBox Validation",
33
"author":"Ortus Solutions <[email protected]>",
4-
"version":"1.6.0",
4+
"version":"2.0.0",
55
"location":"https://downloads.ortussolutions.com/ortussolutions/coldbox-modules/cbvalidation/@build.version@/[email protected]@.zip",
66
"slug":"cbvalidation",
77
"type":"modules",
@@ -31,6 +31,9 @@
3131
".git*"
3232
],
3333
"scripts":{
34-
"toMaster":"recipe build/toMaster.boxr"
34+
"toMaster":"recipe build/toMaster.boxr",
35+
"format":"cfformat run models/**/*.cfc,ModuleConfig.cfc,tests/specs/**/*.cfc,*.cfc --overwrite",
36+
"format:check":"cfformat run models/**/*.cfc,ModuleConfig.cfc,tests/specs/**/*.cfc,*.cfc --check",
37+
"lint":"cflint models/**.cfc --text --html --json --!exitOnError --suppress"
3538
}
3639
}

changelog.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# CHANGELOG
22

3+
## 2.0.0
4+
5+
* `Features` : Removed all interface usages since all cfml engines suck on it.
6+
* `Improvements` : Consistency on all validators to ignore null or empty values except the `Required` validator
7+
* `Improvements` : Formatting consistencies
8+
* `Improvements` : Improve error messages to describe better validation
9+
* `Improvements` : Get away from `evaluate()` instead use `invoke()`
10+
* `Bugs` : Fixed lots of wrong type exceptions
11+
* `Compat` : Remove ACF11 support
12+
313
## 1.5.2
414

515
* `bug` : Added `float` to the type validator which was missing

models/GenericObject.cfc

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
* Great for when you want to validate a form that is not represented by an object.
77
* A generic object that can simulate an object getters from a collection structure.
88
*/
9-
component{
9+
component {
1010

1111
/**
1212
* Constructor
1313
*
1414
* @memento The struct to represent
1515
*/
16-
GenericObject function init( struct memento=structNew() ){
16+
GenericObject function init( struct memento = structNew() ){
1717
variables.collection = arguments.memento;
1818
return this;
1919
}
@@ -32,12 +32,13 @@ component{
3232
* @missingMethodArguments
3333
*/
3434
any function onMissingMethod( required string missingMethodName, required struct missingMethodArguments ){
35-
var key = replacenocase( arguments.missingMethodName, "get", "" );
35+
var key = replaceNoCase( arguments.missingMethodName, "get", "" );
3636

37-
if( structKeyExists( variables.collection, key ) ){
37+
if ( structKeyExists( variables.collection, key ) ) {
3838
return variables.collection[ key ];
3939
}
4040

4141
// Return null
4242
}
43-
}
43+
44+
}

models/IValidationManager.cfc

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*/
88
import cbvalidation.models.*;
99
import cbvalidation.models.result.*;
10-
interface{
10+
interface {
1111

1212
/**
1313
* Validate an object
@@ -25,9 +25,9 @@ interface{
2525
required any target,
2626
string fields,
2727
any constraints,
28-
string locale="",
29-
string excludeFields="",
30-
string includeFields=""
28+
string locale = "",
29+
string excludeFields = "",
30+
string includeFields = ""
3131
);
3232

3333
/**
@@ -58,4 +58,5 @@ interface{
5858
* @constraintThe constraint to store.
5959
*/
6060
IValidationManager function addSharedConstraint( required string name, required struct constraint );
61-
}
61+
62+
}

0 commit comments

Comments
 (0)