diff options
author | Perl Tidy <perltidy@bugzilla.org> | 2018-12-05 21:38:52 +0100 |
---|---|---|
committer | Dylan William Hardison <dylan@hardison.net> | 2018-12-05 23:49:08 +0100 |
commit | 8ec8da0491ad89604700b3e29a227966f6d84ba1 (patch) | |
tree | 9d270f173330ca19700e0ba9f2ee931300646de1 /extensions/Push/lib/Message.pm | |
parent | a7bb5a65b71644d9efce5fed783ed545b9336548 (diff) | |
download | bugzilla-8ec8da0491ad89604700b3e29a227966f6d84ba1.tar.gz bugzilla-8ec8da0491ad89604700b3e29a227966f6d84ba1.tar.xz |
no bug - reformat all the code using the new perltidy rules
Diffstat (limited to 'extensions/Push/lib/Message.pm')
-rw-r--r-- | extensions/Push/lib/Message.pm | 72 |
1 files changed, 37 insertions, 35 deletions
diff --git a/extensions/Push/lib/Message.pm b/extensions/Push/lib/Message.pm index 1beb18ef0..3587de1d9 100644 --- a/extensions/Push/lib/Message.pm +++ b/extensions/Push/lib/Message.pm @@ -27,50 +27,50 @@ use Encode; # initialisation # -use constant DB_TABLE => 'push'; +use constant DB_TABLE => 'push'; use constant DB_COLUMNS => qw( - id - push_ts - payload - change_set - routing_key + id + push_ts + payload + change_set + routing_key ); use constant LIST_ORDER => 'push_ts'; use constant VALIDATORS => { - push_ts => \&_check_push_ts, - payload => \&_check_payload, - change_set => \&_check_change_set, - routing_key => \&_check_routing_key, + push_ts => \&_check_push_ts, + payload => \&_check_payload, + change_set => \&_check_change_set, + routing_key => \&_check_routing_key, }; # this creates an object which doesn't exist on the database sub new_transient { - my $invocant = shift; - my $class = ref($invocant) || $invocant; - my $object = shift; - bless($object, $class) if $object; - return $object; + my $invocant = shift; + my $class = ref($invocant) || $invocant; + my $object = shift; + bless($object, $class) if $object; + return $object; } # take a transient object and commit sub create_from_transient { - my ($self) = @_; - return $self->create($self); + my ($self) = @_; + return $self->create($self); } # # accessors # -sub push_ts { return $_[0]->{'push_ts'}; } -sub payload { return $_[0]->{'payload'}; } -sub change_set { return $_[0]->{'change_set'}; } +sub push_ts { return $_[0]->{'push_ts'}; } +sub payload { return $_[0]->{'payload'}; } +sub change_set { return $_[0]->{'change_set'}; } sub routing_key { return $_[0]->{'routing_key'}; } -sub message_id { return $_[0]->id; } +sub message_id { return $_[0]->id; } sub payload_decoded { - my ($self) = @_; - return from_json($self->{'payload'}); + my ($self) = @_; + return from_json($self->{'payload'}); } # @@ -78,27 +78,29 @@ sub payload_decoded { # sub _check_push_ts { - my ($invocant, $value) = @_; - $value ||= Bugzilla->dbh->selectrow_array('SELECT NOW()'); - return $value; + my ($invocant, $value) = @_; + $value ||= Bugzilla->dbh->selectrow_array('SELECT NOW()'); + return $value; } sub _check_payload { - my ($invocant, $value) = @_; - length($value) || ThrowCodeError('push_invalid_payload'); - return $value; + my ($invocant, $value) = @_; + length($value) || ThrowCodeError('push_invalid_payload'); + return $value; } sub _check_change_set { - my ($invocant, $value) = @_; - (defined($value) && length($value)) || ThrowCodeError('push_invalid_change_set'); - return $value; + my ($invocant, $value) = @_; + (defined($value) && length($value)) + || ThrowCodeError('push_invalid_change_set'); + return $value; } sub _check_routing_key { - my ($invocant, $value) = @_; - (defined($value) && length($value)) || ThrowCodeError('push_invalid_routing_key'); - return $value; + my ($invocant, $value) = @_; + (defined($value) && length($value)) + || ThrowCodeError('push_invalid_routing_key'); + return $value; } 1; |