From 06fea22a5378d52ec870e76f83670f2191f1092b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Tue, 19 Jan 2021 12:29:37 +0100 Subject: [PATCH] =?utf8?q?Zeiterfassung:=20richtige=20Parameter=20f.=20Hin?= =?utf8?q?tergrund-Job=20pr=C3=BCfen=20=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit und - Hash mit validen Parametern umbenannt - exists statt trueish - "die" statt "croak" --- SL/BackgroundJob/ConvertTimeRecordings.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/SL/BackgroundJob/ConvertTimeRecordings.pm b/SL/BackgroundJob/ConvertTimeRecordings.pm index 2df2d8026..30b99f499 100644 --- a/SL/BackgroundJob/ConvertTimeRecordings.pm +++ b/SL/BackgroundJob/ConvertTimeRecordings.pm @@ -21,9 +21,9 @@ use Rose::Object::MakeMethods::Generic ( ); # valid parameters -> better as class members with rose generic set/get -my %params = ( - fromdate => '', - todate => '', +my %valid_params = ( + from_date => '', + to_date => '', customernumbers => '', part_id => '', rounding => 1, @@ -48,7 +48,7 @@ sub run { # check user input param names foreach my $param (keys %{ $data }) { - croak "Not a valid key: $param" unless $params{$param}; + die "Not a valid parameter: $param" unless exists $valid_params{$param}; } # TODO check user input param values - (defaults are assigned later) -- 2.20.1