Merge pull request #6988 from owncloud/oc_api_fix_warinigs
[ocs API] getData() always needs to return an array
This commit is contained in:
commit
84607db284
|
@ -29,7 +29,13 @@ class OC_OCS_Result{
|
||||||
* @param $data mixed the data to return
|
* @param $data mixed the data to return
|
||||||
*/
|
*/
|
||||||
public function __construct($data=null, $code=100, $message=null) {
|
public function __construct($data=null, $code=100, $message=null) {
|
||||||
|
if ($data === null) {
|
||||||
|
$this->data = array();
|
||||||
|
} elseif (!is_array($data)) {
|
||||||
|
$this->data = array($this->data);
|
||||||
|
} else {
|
||||||
$this->data = $data;
|
$this->data = $data;
|
||||||
|
}
|
||||||
$this->statusCode = $code;
|
$this->statusCode = $code;
|
||||||
$this->message = $message;
|
$this->message = $message;
|
||||||
}
|
}
|
||||||
|
@ -79,7 +85,7 @@ class OC_OCS_Result{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get the result data
|
* get the result data
|
||||||
* @return array|string|int
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getData() {
|
public function getData() {
|
||||||
return $this->data;
|
return $this->data;
|
||||||
|
|
Loading…
Reference in New Issue