Skip to content

Commit 9087337

Browse files
committed
made parameter optional
1 parent b42d11c commit 9087337

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/OpenCloud/Compute/Server.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -528,16 +528,17 @@ public function Console($type='novnc') {
528528
* create {rebuild ...} by changing this parameter
529529
* @return json
530530
*/
531-
protected function CreateJson(array $params=array())
531+
protected function CreateJson($params=NULL)
532532
{
533533
// create a blank object
534534
$obj = new \stdClass();
535535

536536
// set a bunch of properties
537537
$obj->server = new \stdClass();
538538

539-
foreach ($params as $key => $ignore)
540-
$obj->server->$key = $this->$key;
539+
if (is_array($params))
540+
foreach ($params as $key => $ignore)
541+
$obj->server->$key = $this->$key;
541542
$obj->server->imageRef = $this->imageRef;
542543
$obj->server->name = $this->name;
543544
$obj->server->flavorRef = $this->flavorRef;

0 commit comments

Comments
 (0)