Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Item14033: perl tidy
  • Loading branch information
MichaelDaum committed Jun 3, 2016
1 parent dbe0224 commit 192a964
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions JsonRpcContrib/lib/Foswiki/Request/JSON.pm
Expand Up @@ -71,7 +71,7 @@ optional method from the path. eg: bin/jsonrpc/SomeNamespace/themethod
sub pathInfo {
my ( $this, $pathInfo ) = @_;

_writeDebug("pathInfo entered " . Data::Dumper::Dumper( \$pathInfo ))
_writeDebug( "pathInfo entered " . Data::Dumper::Dumper( \$pathInfo ) )
if Foswiki::Request::TRACE;

return $_[0]->SUPER::pathInfo() if @_ == 1;
Expand Down Expand Up @@ -152,7 +152,7 @@ Call SUPER::method() to access the http method.
sub method {
my ( $this, $value ) = @_;

_writeDebug("method entered " . Data::Dumper::Dumper( \$value ))
_writeDebug( "method entered " . Data::Dumper::Dumper( \$value ) )
if Foswiki::Request::TRACE;

if ( defined $value && !defined $this->{_jsondata} && lc($value) ne 'post' )
Expand Down Expand Up @@ -214,7 +214,7 @@ sub _establishJSON {
"Invalid JSON-RPC request - no method" )
unless defined $this->jsonmethod();

_writeDebug( "jsonmethod=" . ($this->jsonmethod() || 'undef' ))
_writeDebug( "jsonmethod=" . ( $this->jsonmethod() || 'undef' ) )
if Foswiki::Request::TRACE;

# must not have any other keys other than these
Expand All @@ -240,8 +240,12 @@ sub initFromString {
_writeDebug("initFromString\n$data") if Foswiki::Request::TRACE;

# parse json-rpc request
eval { %{$this->{_jsondata}} = (%{$this->{_jsondata}}, %{$this->json->decode($data)}); };
_writeDebug("after jsondata=".Data::Dumper::Dumper($this->{_jsondata}));
eval {
%{ $this->{_jsondata} } =
( %{ $this->{_jsondata} }, %{ $this->json->decode($data) } );
};
_writeDebug(
"after jsondata=" . Data::Dumper::Dumper( $this->{_jsondata} ) );

if ($@) {
my $error = $@;
Expand Down Expand Up @@ -350,7 +354,8 @@ can both read and write.
sub jsonmethod {
my ( $this, $value ) = @_;

_writeDebug("jsonmethod entered (this=$this)" . Data::Dumper::Dumper( \$value ))
_writeDebug(
"jsonmethod entered (this=$this)" . Data::Dumper::Dumper( \$value ) )
if Foswiki::Request::TRACE;

$this->{_jsondata}{method} = $value if defined $value;
Expand Down Expand Up @@ -439,7 +444,7 @@ sub web {
$this->_establishAddress();
}

_writeDebug("Request->web() returns " . ( $this->{web} || 'undef' ))
_writeDebug( "Request->web() returns " . ( $this->{web} || 'undef' ) )
if Foswiki::Request::TRACE;
return $this->{web};

Expand All @@ -466,7 +471,7 @@ sub topic {
$this->_establishAddress();
}

_writeDebug("Request->topic() returns " . ( $this->{topic} || 'undef' ))
_writeDebug( "Request->topic() returns " . ( $this->{topic} || 'undef' ) )
if Foswiki::Request::TRACE;
return $this->{topic};

Expand Down

0 comments on commit 192a964

Please sign in to comment.