@@ -38,17 +38,14 @@ |
||
38 | 38 | private function setSqlOptions(Request $request) : SqlOptions |
39 | 39 | { |
40 | 40 | $sqlOptions = new SqlOptions(); |
41 | - $page = ($request->input(ModelsInterface::PARAM_PAGE) === null) ? $this->defaultPage : |
|
42 | - $request->input(ModelsInterface::PARAM_PAGE); |
|
43 | - $limit = ($request->input(ModelsInterface::PARAM_LIMIT) === null) ? $this->defaultLimit : |
|
44 | - $request->input(ModelsInterface::PARAM_LIMIT); |
|
41 | + $page = ($request->input(ModelsInterface::PARAM_PAGE) === null) ? $this->defaultPage : $request->input(ModelsInterface::PARAM_PAGE); |
|
42 | + $limit = ($request->input(ModelsInterface::PARAM_LIMIT) === null) ? $this->defaultLimit : $request->input(ModelsInterface::PARAM_LIMIT); |
|
45 | 43 | |
46 | 44 | if ($limit > ModelsInterface::MAX_LIMIT) { |
47 | 45 | throw new AttributesException(ErrorsInterface::JSON_API_ERRORS[ErrorsInterface::HTTP_PARAM_LIMIT], ErrorsInterface::HTTP_PARAM_LIMIT); |
48 | 46 | } |
49 | 47 | |
50 | - $sort = ($request->input(ModelsInterface::PARAM_SORT) === null) ? $this->defaultSort : |
|
51 | - $request->input(ModelsInterface::PARAM_SORT); |
|
48 | + $sort = ($request->input(ModelsInterface::PARAM_SORT) === null) ? $this->defaultSort : $request->input(ModelsInterface::PARAM_SORT); |
|
52 | 49 | |
53 | 50 | $data = ($request->input(ModelsInterface::PARAM_DATA) === NULL) ? ModelsInterface::DEFAULT_DATA |
54 | 51 | : Json::decode(urldecode($request->input(ModelsInterface::PARAM_DATA))); |
@@ -84,7 +84,7 @@ |
||
84 | 84 | { |
85 | 85 | // id must be there anyway |
86 | 86 | $this->data = $data; |
87 | - if(\in_array(ModelsInterface::ID, $this->data, true) === false) |
|
87 | + if (\in_array(ModelsInterface::ID, $this->data, true) === false) |
|
88 | 88 | { |
89 | 89 | $this->data[] = ModelsInterface::ID; |
90 | 90 | } |
@@ -62,7 +62,7 @@ |
||
62 | 62 | { |
63 | 63 | $resource = $this->json->setMeta($meta)->getResource($this->formRequest, $data, $this->entity); |
64 | 64 | |
65 | - return $this->getResponse(Json::prepareSerializedData($resource, $this->sqlOptions->getData())); |
|
65 | + return $this->getResponse(Json::prepareSerializedData($resource, $this->sqlOptions->getData())); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | /** |
@@ -28,7 +28,7 @@ |
||
28 | 28 | . PhpInterface::PHP_EXT; |
29 | 29 | |
30 | 30 | $isCreated = FileManager::createFile($fileController, $this->sourceCode); |
31 | - if($isCreated) |
|
31 | + if ($isCreated) |
|
32 | 32 | { |
33 | 33 | Console::out($fileController . PhpInterface::SPACE . Console::CREATED, Console::COLOR_GREEN); |
34 | 34 | } |
@@ -168,8 +168,7 @@ |
||
168 | 168 | // attrs validation |
169 | 169 | $this->startArray(); |
170 | 170 | if (empty($relationTypes) === false) { |
171 | - $rel = empty($relationTypes[ApiInterface::RAML_TYPE]) ? $relationTypes : |
|
172 | - $relationTypes[ApiInterface::RAML_TYPE]; |
|
171 | + $rel = empty($relationTypes[ApiInterface::RAML_TYPE]) ? $relationTypes : $relationTypes[ApiInterface::RAML_TYPE]; |
|
173 | 172 | |
174 | 173 | $rels = explode(PhpInterface::PIPE, str_replace('[]', '', $rel)); |
175 | 174 | foreach ($rels as $k => $rel) { |
@@ -24,10 +24,10 @@ discard block |
||
24 | 24 | $table = ''; |
25 | 25 | // make entity lc + underscore |
26 | 26 | $words = preg_split(self::PATTERN_SPLIT_UC, lcfirst($objectName)); |
27 | - foreach($words as $key => $word) |
|
27 | + foreach ($words as $key => $word) |
|
28 | 28 | { |
29 | 29 | $table .= $word; |
30 | - if(empty($words[$key + 1]) === false) |
|
30 | + if (empty($words[$key + 1]) === false) |
|
31 | 31 | { |
32 | 32 | $table .= PhpInterface::UNDERSCORE; |
33 | 33 | } |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | $table = ''; |
49 | 49 | // make entity lc + underscore |
50 | 50 | $words = preg_split(self::PATTERN_MERGE_UC, $tableName); |
51 | - foreach($words as $key => $word) |
|
51 | + foreach ($words as $key => $word) |
|
52 | 52 | { |
53 | 53 | $table .= ucfirst(str_replace(PhpInterface::UNDERSCORE, '', $word)); |
54 | 54 | } |
@@ -38,7 +38,7 @@ |
||
38 | 38 | public const CACHE_METHOD = 'setCacheOptions'; |
39 | 39 | |
40 | 40 | // json-api attributes can be in one of: camel-case, snake-case, lisp-case |
41 | - public const DEFAULT_CAMEL_CASE = 'snake-case'; |
|
41 | + public const DEFAULT_CAMEL_CASE = 'snake-case'; |
|
42 | 42 | |
43 | 43 | // todo: make this prop set via config for tests to run normally |
44 | 44 | public const DEFAULT_ACTIVATE = 30; |