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

@ -109,8 +109,8 @@ sub create {
"select count(*) from userProfileField where fieldName=?",
[$fieldName]
);
return undef if $fieldNameExists;
return undef if $class->isReservedFieldName($fieldName);
return if $fieldNameExists;
return if $class->isReservedFieldName($fieldName);
### Data okay, create the field
# Add the record
@ -553,11 +553,11 @@ sub new {
my $class = shift;
my $session = shift;
my $id = shift;
return undef unless ($id);
return undef if $class->isReservedFieldName($id);
return unless ($id);
return if $class->isReservedFieldName($id);
my $properties = $session->db->getRow("userProfileField","fieldName",$id);
# Reject properties that don't exist.
return undef unless scalar keys %$properties;
return unless scalar keys %$properties;
bless {_session=>$session, _properties=>$properties}, $class;
}
@ -731,10 +731,10 @@ The unique ID of a category to assign this field to.
sub setCategory {
my $self = shift;
my $categoryId = shift;
return undef unless ($categoryId);
return unless ($categoryId);
my $currentCategoryId = $self->get("profileCategoryId");
return undef if ($categoryId eq $currentCategoryId);
return if ($categoryId eq $currentCategoryId);
my ($sequenceNumber) = $self->session->db->quickArray("select max(sequenceNumber) from userProfileField where profileCategoryId=".$self->session->db->quote($categoryId));
$self->session->db->setRow("userProfileField","fieldName",{fieldName=>$self->getId, profileCategoryId=>$categoryId, sequenceNumber=>$sequenceNumber+1});