Skip to content
This repository has been archived by the owner on Sep 10, 2021. It is now read-only.

Commit

Permalink
Style compliance
Browse files Browse the repository at this point in the history
  • Loading branch information
mgrauer committed Dec 9, 2015
1 parent b83988a commit fd566cb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions core/controllers/components/ApiitemComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,11 @@ public function itemAddmetadata($args)
$revision = $apihelperComponent->getItemRevision($item, $revisionNumber);

if (!array_key_exists(0, $args)) {
throw new Exception("Missing request body data.", MIDAS_INVALID_PARAMETER);
throw new Exception('Missing request body data.', MIDAS_INVALID_PARAMETER);
}
$json_body = json_decode($args[0]);
if (NULL === $json_body) {
throw new Exception("Request body data must be valid JSON.", MIDAS_INVALID_PARAMETER);
if (null === $json_body) {
throw new Exception('Request body data must be valid JSON.', MIDAS_INVALID_PARAMETER);
}
if (!array_key_exists('metadata', $json_body)) {
throw new Exception("Request body data missing key 'metadata'.", MIDAS_INVALID_PARAMETER);
Expand Down
6 changes: 3 additions & 3 deletions core/tests/controllers/api/RestCallItemMethodsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function testItemAddmetadata()
$itemsFile = $this->loadData('Item', 'default');
$itemDao = $this->Item->load($itemsFile[1]->getKey());

$apipath = '/item/addmetadata/' . $itemDao->getItemId();
$apipath = '/item/addmetadata/'.$itemDao->getItemId();

// No user will fail.
$this->resetAll();
Expand Down Expand Up @@ -77,7 +77,7 @@ public function testItemAddmetadata()
$this->params['useSession'] = 'true';
$this->params[0] = json_encode(array('metadata' => array(
array('element' => 'key1', 'value' => 'val1'),
array('element' => 'key2', 'value' => 'val2')
array('element' => 'key2', 'value' => 'val2'),
)));
$resp = $this->_callRestApi('PUT', $apipath, $userDao);
$this->_assertStatusOk($resp);
Expand Down Expand Up @@ -106,7 +106,7 @@ public function testItemAddmetadata()
$this->params['useSession'] = 'true';
$this->params[0] = json_encode(array('metadata' => array(
array('element' => 'key1', 'value' => 'newval1'),
array('element' => 'key3', 'value' => 'val3')
array('element' => 'key3', 'value' => 'val3'),
)));
$resp = $this->_callRestApi('PUT', $apipath, $userDao);
$this->_assertStatusOk($resp);
Expand Down

0 comments on commit fd566cb

Please sign in to comment.