Skip to content

Commit ff0ef7a

Browse files
committed
Ajustes de códigos
1 parent 10a0447 commit ff0ef7a

6 files changed

+15
-18
lines changed

src/core/DataValidator.Context.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,7 @@ function TDataValidatorContext<T>.IsLatLong(const ACheckDMS: Boolean): T;
623623
Result := Add(TValidatorIsLatLong.Create(ACheckDMS, 'Value is not JWT (JSON Web Token)!'));
624624
end;
625625

626-
function TDataValidatorContext<T>.IsLength(const AMin, AMax: Integer): T;
626+
function TDataValidatorContext<T>.IsLength(const AMin: Integer; const AMax: Integer): T;
627627
begin
628628
Result := Add(TValidatorIsLength.Create(AMin, AMax, Format('Value required length min(%d) and max(%d)!', [AMin, AMax])));
629629
end;

src/core/DataValidator.Information.pas

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ constructor TDataValidatorInformations.Create;
8383
destructor TDataValidatorInformations.Destroy;
8484
begin
8585
FList.Clear;
86-
FList.DisposeOf;
86+
FList.Free;
8787

8888
inherited;
8989
end;
@@ -126,7 +126,7 @@ function TDataValidatorInformations.Message: string;
126126

127127
Result := Trim(LSL.Text);
128128
finally
129-
LSL.DisposeOf
129+
LSL.Free
130130
end;
131131
end;
132132

src/core/DataValidator.Value.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ constructor TDataValidatorValue.Create;
7272
destructor TDataValidatorValue.Destroy;
7373
begin
7474
FList.Clear;
75-
FList.DisposeOf;
75+
FList.Free;
7676

7777
inherited;
7878
end;

src/validators/Validator.Custom.pas

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -69,18 +69,15 @@ function TValidatorCustom.Check: IDataValidatorResult;
6969
LValue := GetValueAsString;
7070
R := False;
7171

72-
try
73-
if Assigned(FCustomExecute) then
74-
R := FCustomExecute(LValue)
75-
else
76-
if Assigned(FCustomMessageExecute) then
77-
begin
78-
LMessage := GetMessage;
79-
R := FCustomMessageExecute(LValue, LMessage);
80-
SetMessage(LMessage);
81-
end;
82-
except
83-
end;
72+
if Assigned(FCustomExecute) then
73+
R := FCustomExecute(LValue)
74+
else
75+
if Assigned(FCustomMessageExecute) then
76+
begin
77+
LMessage := GetMessage;
78+
R := FCustomMessageExecute(LValue, LMessage);
79+
SetMessage(LMessage);
80+
end;
8481

8582
if FIsNot then
8683
R := not R;

src/validators/Validator.IsJWT.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ function TValidatorIsJWT.Check: IDataValidatorResult;
118118
R := (LJSONValue as TJSONObject).TryGetValue<string>('alg', LJSONObjectValue);
119119
finally
120120
if Assigned(LJSONValue) then
121-
LJSONValue.DisposeOf;
121+
LJSONValue.Free;
122122
end;
123123

124124
if not R then

src/validators/Validator.IsPort.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ interface
3636

3737
uses
3838
DataValidator.ItemBase,
39-
System.Math, System.SysUtils;
39+
System.SysUtils;
4040

4141
type
4242
TValidatorIsPort = class(TDataValidatorItemBase, IDataValidatorItem)

0 commit comments

Comments
 (0)