@@ -35,40 +35,34 @@ public function statusAction()
35
35
*/
36
36
public function handleRequestAction ($ authKey , $ version )
37
37
{
38
- if ($ authKey !== $ this ->container ->getParameter ('auth_key ' ))
39
- {
38
+ if ($ authKey !== $ this ->container ->getParameter ('auth_key ' )) {
40
39
return new Response (json_encode (array ("success " => false , "message " => "Invalid authorization key. " )));
41
40
}
42
41
43
- if ($ version !== $ this ->container ->getParameter ('version ' ))
44
- {
42
+ if ($ version !== $ this ->container ->getParameter ('version ' )) {
45
43
return new Response (json_encode (array ("success " => false , "message " => "Invalid api version. " )));
46
44
}
47
45
48
46
$ request = $ this ->getRequest ()->getContent ();
49
- if (empty ($ request ))
50
- {
47
+ if (empty ($ request )) {
51
48
return new Response (json_encode (array ("success " => false , "message " => "Invalid input. " )));
52
49
}
53
50
54
51
$ contents = json_decode ($ request , true );
55
52
56
- if ($ contents === NULL )
57
- {
53
+ if ($ contents === NULL ) {
58
54
return new Response (json_encode (array ("success " => false , "message " => "Wrong data. " )));
59
55
}
60
56
61
- if (!array_key_exists ("data " , $ contents ))
62
- {
57
+ if (!array_key_exists ("data " , $ contents )) {
63
58
return new Response (json_encode (array ("success " => false , "message " => "Insufficient data provided. " )));
64
59
}
65
60
66
61
if ($ contents ["type " ] == "compiler " ) {
67
62
return new Response ($ this ->compile ($ contents ["data " ]));
68
63
}
69
64
70
- if ($ contents ["type " ] == "library " )
71
- {
65
+ if ($ contents ["type " ] == "library " ) {
72
66
return new Response ($ this ->getLibraryInfo (json_encode ($ contents ["data " ])));
73
67
}
74
68
0 commit comments