@@ -105,7 +105,6 @@ discard block |
||
105 | 105 | /** |
106 | 106 | * De-encode the POST from application/json vars for use |
107 | 107 | * |
108 | - * @param array $post |
|
109 | 108 | * |
110 | 109 | * @return array |
111 | 110 | */ |
@@ -132,10 +131,10 @@ discard block |
||
132 | 131 | * Takes common requests and appends them to the query object. Any other |
133 | 132 | * special requirements will be handled after |
134 | 133 | * |
135 | - * @param Ps2alerts\Api\QueryObjects\QueryObject $queryObject |
|
134 | + * @param QueryObject $queryObject |
|
136 | 135 | * @param array $post |
137 | 136 | * |
138 | - * @return Ps2alerts\Api\QueryObjects\QueryObject |
|
137 | + * @return QueryObject |
|
139 | 138 | */ |
140 | 139 | public function setupQueryObject(QueryObject $queryObject, array $post) |
141 | 140 | { |
@@ -75,27 +75,27 @@ discard block |
||
75 | 75 | */ |
76 | 76 | public function appendRedisKey($post, $redisKey) |
77 | 77 | { |
78 | - if (! empty($post['selects'])) { |
|
78 | + if (!empty($post['selects'])) { |
|
79 | 79 | $whereMD5 = md5(json_encode($post['selects'])); |
80 | 80 | $redisKey .= "/select:{$whereMD5}"; |
81 | 81 | } |
82 | 82 | |
83 | - if (! empty($post['wheres'])) { |
|
83 | + if (!empty($post['wheres'])) { |
|
84 | 84 | $whereMD5 = md5(json_encode($post['wheres'])); |
85 | 85 | $redisKey .= "/where:{$whereMD5}"; |
86 | 86 | } |
87 | 87 | |
88 | - if (! empty($post['whereIns'])) { |
|
88 | + if (!empty($post['whereIns'])) { |
|
89 | 89 | $whereInMD5 = md5(json_encode($post['whereIns'])); |
90 | 90 | $redisKey .= "/whereIn:{$whereInMD5}"; |
91 | 91 | } |
92 | 92 | |
93 | - if (! empty($post['orderBy'])) { |
|
93 | + if (!empty($post['orderBy'])) { |
|
94 | 94 | $orderMD5 = md5(json_encode($post['orderBy'])); |
95 | 95 | $redisKey .= "/order:{$orderMD5}"; |
96 | 96 | } |
97 | 97 | |
98 | - if (empty($post['limit']) || ! isset($post['limit'])) { |
|
98 | + if (empty($post['limit']) || !isset($post['limit'])) { |
|
99 | 99 | $redisKey .= "/limit:{$post['limit']}"; |
100 | 100 | } |
101 | 101 | |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | // Cheat, dirty hack to get everything out as an array |
118 | 118 | $post = json_decode(json_encode($post), true); |
119 | 119 | |
120 | - if (empty($post['limit']) || ! isset($post['limit'])) { |
|
120 | + if (empty($post['limit']) || !isset($post['limit'])) { |
|
121 | 121 | $post['limit'] = 10; |
122 | 122 | } |
123 | 123 | |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | */ |
140 | 140 | public function setupQueryObject(QueryObject $queryObject, array $post) |
141 | 141 | { |
142 | - if (! empty($post['wheres'])) { |
|
142 | + if (!empty($post['wheres'])) { |
|
143 | 143 | foreach ($post['wheres'] as $key => $value) { |
144 | 144 | if ($key !== 'lessthan' && $key !== 'morethan') { |
145 | 145 | $queryObject->addWhere([ |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | } |
150 | 150 | } |
151 | 151 | |
152 | - if (! empty($post['wheres']['lessthan'])) { |
|
152 | + if (!empty($post['wheres']['lessthan'])) { |
|
153 | 153 | foreach ($post['wheres']['lessthan'] as $key => $value) { |
154 | 154 | $queryObject->addWhere([ |
155 | 155 | 'col' => $key, |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | } |
160 | 160 | } |
161 | 161 | |
162 | - if (! empty($post['wheres']['morethan'])) { |
|
162 | + if (!empty($post['wheres']['morethan'])) { |
|
163 | 163 | foreach ($post['wheres']['morethan'] as $key => $value) { |
164 | 164 | $queryObject->addWhere([ |
165 | 165 | 'col' => $key, |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | } |
171 | 171 | } |
172 | 172 | |
173 | - if (! empty($post['whereIns'])) { |
|
173 | + if (!empty($post['whereIns'])) { |
|
174 | 174 | foreach ($post['whereIns'] as $key => $value) { |
175 | 175 | // Escape strings manually, incase of player IDs etc |
176 | 176 | foreach ($value as $i => $val) { |
@@ -186,16 +186,16 @@ discard block |
||
186 | 186 | } |
187 | 187 | } |
188 | 188 | |
189 | - if (! empty($post['orderBy'])) { |
|
189 | + if (!empty($post['orderBy'])) { |
|
190 | 190 | $queryObject->setOrderBy(array_keys($post['orderBy'])[0]); |
191 | 191 | $queryObject->setOrderByDirection(array_values($post['orderBy'])[0]); |
192 | 192 | } |
193 | 193 | |
194 | - if (! empty($post['limit'])) { |
|
194 | + if (!empty($post['limit'])) { |
|
195 | 195 | $queryObject->setLimit($post['limit']); |
196 | 196 | } |
197 | 197 | |
198 | - if (! empty($this->getFlags())) { |
|
198 | + if (!empty($this->getFlags())) { |
|
199 | 199 | // If there are some funky things we have to do, set them. |
200 | 200 | $queryObject->setFlags($this->getFlags()); |
201 | 201 | } |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | * |
32 | 32 | * @param \Ps2alerts\Api\Repository\AlertRepository $repository |
33 | 33 | * @param \Ps2alerts\Api\Loader\Metrics\MapMetricsLoader $mapLoader |
34 | - * @param \Ps2alerts\Api\Helper\DataFormatter $dataFormatter |
|
34 | + * @param DataFormatterHelper $dataFormatter |
|
35 | 35 | */ |
36 | 36 | public function __construct( |
37 | 37 | AlertRepository $repository, |
@@ -49,7 +49,6 @@ discard block |
||
49 | 49 | /** |
50 | 50 | * Read total counts for alerts |
51 | 51 | * |
52 | - * @param array $post |
|
53 | 52 | * |
54 | 53 | * @return array |
55 | 54 | */ |