Skip to content

Commit 0984a5d

Browse files
committed
PSR-2 if-s
1 parent 3398316 commit 0984a5d

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

Symfony/src/Codebender/BuilderBundle/Controller/DefaultController.php

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,40 +35,34 @@ public function statusAction()
3535
*/
3636
public function handleRequestAction($authKey, $version)
3737
{
38-
if ($authKey !== $this->container->getParameter('auth_key'))
39-
{
38+
if ($authKey !== $this->container->getParameter('auth_key')) {
4039
return new Response(json_encode(array("success" => false, "message" => "Invalid authorization key.")));
4140
}
4241

43-
if ($version !== $this->container->getParameter('version'))
44-
{
42+
if ($version !== $this->container->getParameter('version')) {
4543
return new Response(json_encode(array("success" => false, "message" => "Invalid api version.")));
4644
}
4745

4846
$request = $this->getRequest()->getContent();
49-
if (empty($request))
50-
{
47+
if (empty($request)) {
5148
return new Response(json_encode(array("success" => false, "message" => "Invalid input.")));
5249
}
5350

5451
$contents = json_decode($request, true);
5552

56-
if ($contents === NULL)
57-
{
53+
if ($contents === NULL) {
5854
return new Response(json_encode(array("success" => false, "message" => "Wrong data.")));
5955
}
6056

61-
if (!array_key_exists("data", $contents))
62-
{
57+
if (!array_key_exists("data", $contents)) {
6358
return new Response(json_encode(array("success" => false, "message" => "Insufficient data provided.")));
6459
}
6560

6661
if ($contents["type"] == "compiler") {
6762
return new Response($this->compile($contents["data"]));
6863
}
6964

70-
if ($contents["type"] == "library")
71-
{
65+
if ($contents["type"] == "library") {
7266
return new Response($this->getLibraryInfo(json_encode($contents["data"])));
7367
}
7468

0 commit comments

Comments
 (0)