diff options
author | Dylan William Hardison <dylan@hardison.net> | 2017-07-05 20:43:18 +0200 |
---|---|---|
committer | Dylan William Hardison <dylan@hardison.net> | 2017-07-07 00:19:20 +0200 |
commit | 37722eca39874bb6abdcd120e3e458bd62dea62b (patch) | |
tree | 57a9a9970c00ec77baecab7e154ef7dfcef863fe /Bugzilla/Field | |
parent | a6f98de0d4e842351222b0173a1fff151da8738e (diff) | |
download | bugzilla-37722eca39874bb6abdcd120e3e458bd62dea62b.tar.gz bugzilla-37722eca39874bb6abdcd120e3e458bd62dea62b.tar.xz |
Bug 1377933 - Remove trailing whitespace from all perl files
Diffstat (limited to 'Bugzilla/Field')
-rw-r--r-- | Bugzilla/Field/Choice.pm | 16 | ||||
-rw-r--r-- | Bugzilla/Field/ChoiceInterface.pm | 14 |
2 files changed, 15 insertions, 15 deletions
diff --git a/Bugzilla/Field/Choice.pm b/Bugzilla/Field/Choice.pm index b35006501..10f8f38e6 100644 --- a/Bugzilla/Field/Choice.pm +++ b/Bugzilla/Field/Choice.pm @@ -108,7 +108,7 @@ EOC # Constructors # ################ -# We just make new() enforce this, which should give developers +# We just make new() enforce this, which should give developers # the understanding that you can't use Bugzilla::Field::Choice # without calling type(). sub new { @@ -177,7 +177,7 @@ sub remove_from_db { }); } if ($self->is_static) { - ThrowUserError('fieldvalue_not_deletable', + ThrowUserError('fieldvalue_not_deletable', { field => $self->field, value => $self }); } if ($self->bug_count) { @@ -211,7 +211,7 @@ sub _check_isactive { if (!$value and ref $invocant) { if ($invocant->is_default) { my $field = $invocant->field; - ThrowUserError('fieldvalue_is_default', + ThrowUserError('fieldvalue_is_default', { value => $invocant, field => $field, param_name => $invocant->DEFAULT_MAP->{$field->name} }); @@ -232,8 +232,8 @@ sub _check_value { $value = trim($value); # Make sure people don't rename static values - if (blessed($invocant) && $value ne $invocant->name - && $invocant->is_static) + if (blessed($invocant) && $value ne $invocant->name + && $invocant->is_static) { ThrowUserError('fieldvalue_not_editable', { field => $field, old_value => $invocant }); @@ -245,7 +245,7 @@ sub _check_value { my $exists = $invocant->type($field)->new({ name => $value }); if ($exists && (!blessed($invocant) || $invocant->id != $exists->id)) { - ThrowUserError('fieldvalue_already_exists', + ThrowUserError('fieldvalue_already_exists', { field => $field, value => $exists }); } @@ -291,12 +291,12 @@ Bugzilla::Field::Choice - A legal value for a <select>-type field. my $choices = Bugzilla::Field::Choice->type($field)->new_from_list([1,2,3]); my $choices = Bugzilla::Field::Choice->type($field)->get_all(); - my $choices = Bugzilla::Field::Choice->type($field->match({ sortkey => 10 }); + my $choices = Bugzilla::Field::Choice->type($field->match({ sortkey => 10 }); =head1 DESCRIPTION This is an implementation of L<Bugzilla::Object>, but with a twist. -You can't call any class methods (such as C<new>, C<create>, etc.) +You can't call any class methods (such as C<new>, C<create>, etc.) directly on C<Bugzilla::Field::Choice> itself. Instead, you have to call C<Bugzilla::Field::Choice-E<gt>type($field)> to get the class you're going to instantiate, and then you call the methods on that. diff --git a/Bugzilla/Field/ChoiceInterface.pm b/Bugzilla/Field/ChoiceInterface.pm index cdb43d6d0..bcfd75578 100644 --- a/Bugzilla/Field/ChoiceInterface.pm +++ b/Bugzilla/Field/ChoiceInterface.pm @@ -55,7 +55,7 @@ sub bug_count { WHERE value = ?", undef, $self->name); } else { - $count = $dbh->selectrow_array("SELECT COUNT(*) FROM bugs + $count = $dbh->selectrow_array("SELECT COUNT(*) FROM bugs WHERE $fname = ?", undef, $self->name); } @@ -69,7 +69,7 @@ sub field { my $cache = Bugzilla->request_cache; # This is just to make life easier for subclasses. Our auto-generated # subclasses from Bugzilla::Field::Choice->type() already have this set. - $cache->{"field_$class"} ||= + $cache->{"field_$class"} ||= new Bugzilla::Field({ name => $class->FIELD_NAME }); return $cache->{"field_$class"}; } @@ -134,7 +134,7 @@ sub controlled_values { my %controlled_values; require Bugzilla::Field::Choice; foreach my $field (@$fields) { - $controlled_values{$field->name} = + $controlled_values{$field->name} = Bugzilla::Field::Choice->type($field) ->match({ visibility_value_id => $self->id }); } @@ -163,13 +163,13 @@ sub is_visible_on_bug { # Values with a visibility value are only shown if the visibility # value is set on the bug. - return $visibility_value->is_set_on_bug($bug); + return $visibility_value->is_set_on_bug($bug); } sub is_set_on_bug { my ($self, $bug) = @_; my $field_name = $self->FIELD_NAME; - # This allows bug/create/create.html.tmpl to pass in a hashref that + # This allows bug/create/create.html.tmpl to pass in a hashref that # looks like a bug object. my $value = blessed($bug) ? $bug->$field_name : $bug->{$field_name}; $value = $value->name if blessed($value); @@ -244,7 +244,7 @@ value is set in its field. Returns a hashref of arrayrefs. The hash keys are the names of fields, and the values are arrays of objects that implement -C<Bugzilla::Field::ChoiceInterface>, representing values that this value +C<Bugzilla::Field::ChoiceInterface>, representing values that this value controls the visibility of, for that field. =item C<visibility_value> @@ -255,7 +255,7 @@ value to appear in the UI. =item C<is_visible_on_bug> -Returns C<1> if, according to the settings of C<is_active> and +Returns C<1> if, according to the settings of C<is_active> and C<visibility_value>, this value should be displayed as an option when viewing a bug. Returns C<0> otherwise. |