Skip to content

Commit b6e3e63

Browse files
Merge pull request chriskacerguis#559 from softwarespot/pointless-nested-ifs
Removed pointless nested ifs
2 parents 072753b + 8187c2c commit b6e3e63

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

application/libraries/REST_Controller.php

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1349,13 +1349,10 @@ protected function _parse_put()
13491349
{
13501350
$this->request->body = $this->input->raw_input_stream;
13511351
}
1352-
else
1352+
else if ($this->input->method() === 'put')
13531353
{
1354-
// If no filetype is provided, then there are probably just arguments
1355-
if ($this->input->method() === 'put')
1356-
{
1357-
$this->_put_args = $this->input->input_stream();
1358-
}
1354+
// If no filetype is provided, then there are probably just arguments
1355+
$this->_put_args = $this->input->input_stream();
13591356
}
13601357
}
13611358

@@ -1402,13 +1399,10 @@ protected function _parse_patch()
14021399
{
14031400
$this->request->body = $this->input->raw_input_stream;
14041401
}
1405-
else
1402+
else if ($this->input->method() === 'patch')
14061403
{
14071404
// If no filetype is provided, then there are probably just arguments
1408-
if ($this->input->method() === 'patch')
1409-
{
1410-
$this->_patch_args = $this->input->input_stream();
1411-
}
1405+
$this->_patch_args = $this->input->input_stream();
14121406
}
14131407
}
14141408

0 commit comments

Comments
 (0)