From 8ec8da0491ad89604700b3e29a227966f6d84ba1 Mon Sep 17 00:00:00 2001 From: Perl Tidy Date: Wed, 5 Dec 2018 15:38:52 -0500 Subject: no bug - reformat all the code using the new perltidy rules --- extensions/Push/lib/Connector/Base.pm | 99 +++++++++++++++++++---------------- 1 file changed, 53 insertions(+), 46 deletions(-) (limited to 'extensions/Push/lib/Connector/Base.pm') diff --git a/extensions/Push/lib/Connector/Base.pm b/extensions/Push/lib/Connector/Base.pm index ee41bd160..bd46fe6b4 100644 --- a/extensions/Push/lib/Connector/Base.pm +++ b/extensions/Push/lib/Connector/Base.pm @@ -18,59 +18,65 @@ use Bugzilla::Extension::Push::BacklogQueue; use Bugzilla::Extension::Push::Backoff; sub new { - my ($class) = @_; - my $self = {}; - bless($self, $class); - ($self->{name}) = $class =~ /^.+:(.+)$/; - $self->init(); - return $self; + my ($class) = @_; + my $self = {}; + bless($self, $class); + ($self->{name}) = $class =~ /^.+:(.+)$/; + $self->init(); + return $self; } sub name { - my $self = shift; - return $self->{name}; + my $self = shift; + return $self->{name}; } sub init { - my ($self) = @_; - # abstract - # perform any initialisation here - # will be run when created by the web pages or by the daemon - # and also when the configuration needs to be reloaded + my ($self) = @_; + + # abstract + # perform any initialisation here + # will be run when created by the web pages or by the daemon + # and also when the configuration needs to be reloaded } sub stop { - my ($self) = @_; - # abstract - # run from the daemon only; disconnect from remote hosts, etc + my ($self) = @_; + + # abstract + # run from the daemon only; disconnect from remote hosts, etc } sub should_send { - my ($self, $message) = @_; - # abstract - # return boolean indicating if the connector will be sending the message. - # this will be called each message, and should be a very quick simple test. - # the connector can perform a more exhaustive test in the send() method. - return 0; + my ($self, $message) = @_; + + # abstract + # return boolean indicating if the connector will be sending the message. + # this will be called each message, and should be a very quick simple test. + # the connector can perform a more exhaustive test in the send() method. + return 0; } sub send { - my ($self, $message) = @_; - # abstract - # deliver the message, daemon only + my ($self, $message) = @_; + + # abstract + # deliver the message, daemon only } sub options { - my ($self) = @_; - # abstract - # return an array of configuration variables - return (); + my ($self) = @_; + + # abstract + # return an array of configuration variables + return (); } sub options_validate { - my ($class, $config) = @_; - # abstract, static - # die if a combination of options in $config is invalid + my ($class, $config) = @_; + + # abstract, static + # die if a combination of options in $config is invalid } # @@ -78,29 +84,30 @@ sub options_validate { # sub config { - my ($self) = @_; - if (!$self->{config}) { - $self->load_config(); - } - return $self->{config}; + my ($self) = @_; + if (!$self->{config}) { + $self->load_config(); + } + return $self->{config}; } sub load_config { - my ($self) = @_; - my $config = Bugzilla::Extension::Push::Config->new($self->name, $self->options); - $config->load(); - $self->{config} = $config; + my ($self) = @_; + my $config + = Bugzilla::Extension::Push::Config->new($self->name, $self->options); + $config->load(); + $self->{config} = $config; } sub enabled { - my ($self) = @_; - return $self->config->{enabled} eq 'Enabled'; + my ($self) = @_; + return $self->config->{enabled} eq 'Enabled'; } sub backlog { - my ($self) = @_; - $self->{backlog} ||= Bugzilla::Extension::Push::BacklogQueue->new($self->name); - return $self->{backlog}; + my ($self) = @_; + $self->{backlog} ||= Bugzilla::Extension::Push::BacklogQueue->new($self->name); + return $self->{backlog}; } 1; -- cgit v1.2.3-24-g4f1b