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 /Bugzilla/WebService/Bugzilla.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 'Bugzilla/WebService/Bugzilla.pm')
-rw-r--r-- | Bugzilla/WebService/Bugzilla.pm | 120 |
1 files changed, 60 insertions, 60 deletions
diff --git a/Bugzilla/WebService/Bugzilla.pm b/Bugzilla/WebService/Bugzilla.pm index 8e95028cb..f8f745a55 100644 --- a/Bugzilla/WebService/Bugzilla.pm +++ b/Bugzilla/WebService/Bugzilla.pm @@ -21,77 +21,76 @@ use Try::Tiny; use DateTime; # Basic info that is needed before logins -use constant LOGIN_EXEMPT => { - timezone => 1, - version => 1, -}; +use constant LOGIN_EXEMPT => {timezone => 1, version => 1,}; use constant READ_ONLY => qw( - extensions - timezone - time - version - jobqueue_status + extensions + timezone + time + version + jobqueue_status ); use constant PUBLIC_METHODS => qw( - extensions - time - timezone - version - jobqueue_status + extensions + time + timezone + version + jobqueue_status ); sub version { - my $self = shift; - return { version => $self->type('string', BUGZILLA_VERSION) }; + my $self = shift; + return {version => $self->type('string', BUGZILLA_VERSION)}; } sub extensions { - my $self = shift; - - my %retval; - foreach my $extension (@{ Bugzilla->extensions }) { - my $version = $extension->VERSION || 0; - my $name = $extension->NAME; - $retval{$name}->{version} = $self->type('string', $version); - } - return { extensions => \%retval }; + my $self = shift; + + my %retval; + foreach my $extension (@{Bugzilla->extensions}) { + my $version = $extension->VERSION || 0; + my $name = $extension->NAME; + $retval{$name}->{version} = $self->type('string', $version); + } + return {extensions => \%retval}; } sub timezone { - my $self = shift; - # All Webservices return times in UTC; Use UTC here for backwards compat. - return { timezone => $self->type('string', "+0000") }; + my $self = shift; + + # All Webservices return times in UTC; Use UTC here for backwards compat. + return {timezone => $self->type('string', "+0000")}; } sub time { - my ($self) = @_; - # All Webservices return times in UTC; Use UTC here for backwards compat. - # Hardcode values where appropriate - my $dbh = Bugzilla->dbh; - - my $db_time = $dbh->selectrow_array('SELECT LOCALTIMESTAMP(0)'); - $db_time = datetime_from($db_time, 'UTC'); - my $now_utc = DateTime->now(); - - return { - db_time => $self->type('dateTime', $db_time), - web_time => $self->type('dateTime', $now_utc), - web_time_utc => $self->type('dateTime', $now_utc), - tz_name => $self->type('string', 'UTC'), - tz_offset => $self->type('string', '+0000'), - tz_short_name => $self->type('string', 'UTC'), - }; + my ($self) = @_; + + # All Webservices return times in UTC; Use UTC here for backwards compat. + # Hardcode values where appropriate + my $dbh = Bugzilla->dbh; + + my $db_time = $dbh->selectrow_array('SELECT LOCALTIMESTAMP(0)'); + $db_time = datetime_from($db_time, 'UTC'); + my $now_utc = DateTime->now(); + + return { + db_time => $self->type('dateTime', $db_time), + web_time => $self->type('dateTime', $now_utc), + web_time_utc => $self->type('dateTime', $now_utc), + tz_name => $self->type('string', 'UTC'), + tz_offset => $self->type('string', '+0000'), + tz_short_name => $self->type('string', 'UTC'), + }; } sub jobqueue_status { - my ( $self, $params ) = @_; + my ($self, $params) = @_; - Bugzilla->login(LOGIN_REQUIRED); + Bugzilla->login(LOGIN_REQUIRED); - my $dbh = Bugzilla->dbh; - my $query = q{ + my $dbh = Bugzilla->dbh; + my $query = q{ SELECT COUNT(*) AS total, COALESCE( @@ -105,17 +104,18 @@ sub jobqueue_status { ON f.funcid = j.funcid; }; - my $status; - try { - $status = $dbh->selectrow_hashref($query); - $status->{errors} = 0 + $status->{errors}; - $status->{total} = 0 + $status->{total}; - } catch { - ERROR($_); - ThrowCodeError('jobqueue_status_error'); - }; - - return $status; + my $status; + try { + $status = $dbh->selectrow_hashref($query); + $status->{errors} = 0 + $status->{errors}; + $status->{total} = 0 + $status->{total}; + } + catch { + ERROR($_); + ThrowCodeError('jobqueue_status_error'); + }; + + return $status; } 1; |