first round of Perl::Critic cleanups. Do not use return undef, use a bare return instead

This commit is contained in:
Colin Kuskie 2007-12-05 00:30:43 +00:00
parent 75041656ee
commit 96178fd70c
92 changed files with 209 additions and 209 deletions

View file

@ -295,12 +295,12 @@ sub new {
my $session = shift;
my $activityId = shift;
my $main = $session->db->getRow("WorkflowActivity","activityId", $activityId);
return undef unless $main->{activityId};
return unless $main->{activityId};
$class = $main->{className};
(my $module = "$class.pm") =~ s{'|::}{/}g;
unless (eval { require $module; 1 }) {
$session->errorHandler->error("Couldn't compile workflow activity package: ".$class.". Root cause: ".$@);
return undef;
return;
}
my $sub = $session->db->buildHashRef("select name,value from WorkflowActivityData where activityId=?",[$activityId]);
my %data = (%{$main}, %{$sub});
@ -334,14 +334,14 @@ sub newByPropertyHashRef {
my $class = shift;
my $session = shift;
my $properties = shift;
return undef unless defined $properties;
return undef unless exists $properties->{className};
return unless defined $properties;
return unless exists $properties->{className};
my $className = $properties->{className};
my $cmd = "use ".$className;
eval ($cmd);
if ($@) {
$session->errorHandler->warn("Couldn't compile activity package: ".$className.". Root cause: ".$@);
return undef;
return;
}
bless {_session=>$session, _id=>$properties->{activityId}, _data => $properties}, $className;
}

View file

@ -176,7 +176,7 @@ sub new {
my $session = shift;
my $taskId = shift;
my $data = $session->db->getRow("WorkflowSchedule","taskId", $taskId);
return undef unless $data->{taskId};
return unless $data->{taskId};
bless {_session=>$session, _id=>$taskId, _data=>$data}, $class;
}

View file

@ -68,7 +68,7 @@ sub create {
? JSON::objToJson({parameters => $properties->{parameters}}, {pretty => 1, indent => 4, autoconv=>0, skipinvalid=>1})
: undef;
my ($count) = $session->db->quickArray("select count(*) from WorkflowInstance where workflowId=? and parameters=?",[$properties->{workflowId},$params]);
return undef if ($isSingleton && $count);
return if ($isSingleton && $count);
# create instance
my $instanceId = $session->db->setRow("WorkflowInstance","instanceId",{instanceId=>"new", runningSince=>time()});
@ -203,7 +203,7 @@ Returns a reference to the next activity in this workflow from the current posit
sub getNextActivity {
my $self = shift;
my $workflow = $self->getWorkflow;
return undef unless defined $workflow;
return unless defined $workflow;
return $workflow->getNextActivity($self->get("currentActivityId"));
}
@ -261,7 +261,7 @@ sub new {
my $session = shift;
my $instanceId = shift;
my $data = $session->db->getRow("WorkflowInstance","instanceId", $instanceId);
return undef unless $data->{instanceId};
return unless $data->{instanceId};
bless {_session=>$session, _id=>$instanceId, _data=>$data}, $class;
}