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

Commit fd566cb

Browse files
author
mgrauer
committed
Style compliance
1 parent b83988a commit fd566cb

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

core/controllers/components/ApiitemComponent.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,11 +205,11 @@ public function itemAddmetadata($args)
205205
$revision = $apihelperComponent->getItemRevision($item, $revisionNumber);
206206

207207
if (!array_key_exists(0, $args)) {
208-
throw new Exception("Missing request body data.", MIDAS_INVALID_PARAMETER);
208+
throw new Exception('Missing request body data.', MIDAS_INVALID_PARAMETER);
209209
}
210210
$json_body = json_decode($args[0]);
211-
if (NULL === $json_body) {
212-
throw new Exception("Request body data must be valid JSON.", MIDAS_INVALID_PARAMETER);
211+
if (null === $json_body) {
212+
throw new Exception('Request body data must be valid JSON.', MIDAS_INVALID_PARAMETER);
213213
}
214214
if (!array_key_exists('metadata', $json_body)) {
215215
throw new Exception("Request body data missing key 'metadata'.", MIDAS_INVALID_PARAMETER);

core/tests/controllers/api/RestCallItemMethodsTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function testItemAddmetadata()
3535
$itemsFile = $this->loadData('Item', 'default');
3636
$itemDao = $this->Item->load($itemsFile[1]->getKey());
3737

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

4040
// No user will fail.
4141
$this->resetAll();
@@ -77,7 +77,7 @@ public function testItemAddmetadata()
7777
$this->params['useSession'] = 'true';
7878
$this->params[0] = json_encode(array('metadata' => array(
7979
array('element' => 'key1', 'value' => 'val1'),
80-
array('element' => 'key2', 'value' => 'val2')
80+
array('element' => 'key2', 'value' => 'val2'),
8181
)));
8282
$resp = $this->_callRestApi('PUT', $apipath, $userDao);
8383
$this->_assertStatusOk($resp);
@@ -106,7 +106,7 @@ public function testItemAddmetadata()
106106
$this->params['useSession'] = 'true';
107107
$this->params[0] = json_encode(array('metadata' => array(
108108
array('element' => 'key1', 'value' => 'newval1'),
109-
array('element' => 'key3', 'value' => 'val3')
109+
array('element' => 'key3', 'value' => 'val3'),
110110
)));
111111
$resp = $this->_callRestApi('PUT', $apipath, $userDao);
112112
$this->_assertStatusOk($resp);

0 commit comments

Comments
 (0)