Commit c9cd1118 authored by Avris's avatar Avris

update to micrus v3.1

parent 3b98801f
......@@ -49,16 +49,4 @@ class BaseApiController extends Controller
$this->project = $auth->getProject();
}
/**
* @return array
*/
public function getRequestBody()
{
if ($this->jsonBody !== null) {
return $this->jsonBody;
}
return $this->jsonBody = json_decode(file_get_contents('php://input'), true);
}
}
......@@ -48,8 +48,10 @@ class ServerController extends BaseApiController
$projectUser = $this->getProjectUser();
$update = new ServerUpdate($server, $projectUser ? $projectUser->getUser() : null);
$update->setBranch((string) BagHelper::magicGetter($this->getRequestBody(), 'branch'));
$update->setAutoRelease($this->buildAutoRelease(BagHelper::magicGetter($this->getRequestBody(), ('autoRelease'))));
$update->setBranch((string) BagHelper::magicGetter($this->getRequest()->getJsonBody(), 'branch'));
$update->setAutoRelease($this->buildAutoRelease(
BagHelper::magicGetter($this->getRequest()->getJsonBody(), ('autoRelease')
)));
$server->take($update);
$this->getEm()->persist($server);
......@@ -89,7 +91,7 @@ class ServerController extends BaseApiController
*/
protected function getProjectUser()
{
$userIdentifier = BagHelper::magicGetter($this->getRequestBody(), 'user');
$userIdentifier = BagHelper::magicGetter($this->getRequest()->getJsonBody(), 'user');
return $userIdentifier
? $this->project->getProjectUserByIdentifier(strtolower(trim($userIdentifier)))
......
......@@ -94,7 +94,7 @@ class Project implements \JsonSerializable
}
/**
* @return int
* @return string
*/
public function getId()
{
......
......@@ -109,7 +109,7 @@ class ProjectUser implements \JsonSerializable
}
/**
* @return int
* @return string
*/
public function getId()
{
......
......@@ -67,7 +67,7 @@ class Server implements \JsonSerializable
}
/**
* @return int
* @return string
*/
public function getId()
{
......
......@@ -69,7 +69,7 @@ class ServerUpdate implements \JsonSerializable
}
/**
* @return int
* @return string
*/
public function getId()
{
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment