Test Setup Failed
Push — master ( 6def47...3181cf )
by William Johnson S.
02:29
created
src/HttpResponse.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@
 block discarded – undo
56 56
     {
57 57
         $json = json_decode($this->body);
58 58
         if (json_last_error() !== JSON_ERROR_NONE) {
59
-            throw new \InvalidArgumentException('Failed to decode json:' . json_last_error_msg());
59
+            throw new \InvalidArgumentException('Failed to decode json:'.json_last_error_msg());
60 60
         }
61 61
 
62 62
         return $json;
Please login to merge, or discard this patch.
src/HttpApi.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -131,8 +131,8 @@  discard block
 block discarded – undo
131 131
         $month = IntHelper::parseNullableInt($month);
132 132
         $year = IntHelper::parseNullableInt($year);
133 133
 
134
-        $month = $month ?: (int)date('m') + (intval(date('d')) >= 20 ? 1 : 0);
135
-        $year = $year ?: (int)date('Y');
134
+        $month = $month ?: (int) date('m') + (intval(date('d')) >= 20 ? 1 : 0);
135
+        $year = $year ?: (int) date('Y');
136 136
 
137 137
         return $this->getPunchesFromPage($this->getPunchesPage($month, $year));
138 138
     }
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
         }
162 162
         $punches = $this->getPunches($month, $year);
163 163
 
164
-        return array_filter($punches['punches'], function (\DateTime $punchDateTime) use ($day) {
164
+        return array_filter($punches['punches'], function(\DateTime $punchDateTime) use ($day) {
165 165
             return (int) $punchDateTime->format('d') === (int) $day;
166 166
         });
167 167
     }
@@ -359,7 +359,7 @@  discard block
 block discarded – undo
359 359
     private function getPunchesFromPage(IHttpResponse $punchesPageResponse)
360 360
     {
361 361
         if ($punchesPageResponse->getHttpStatus() !== IHttpClient::HTTP_STATUS_OK) {
362
-            throw new InvalidArgumentException('The request returned http status ' . $punchesPageResponse->getHttpStatus());
362
+            throw new InvalidArgumentException('The request returned http status '.$punchesPageResponse->getHttpStatus());
363 363
         }
364 364
 
365 365
         $punches = $this->parsePunchesPage($punchesPageResponse);
Please login to merge, or discard this patch.
src/RestApi.php 2 patches
Doc Comments   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
     /**
212 212
      * Gets the user data and punches.
213 213
      *
214
-     * @param null $field
214
+     * @param string $field
215 215
      *
216 216
      * @return mixed
217 217
      */
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
     /**
228 228
      * Gets all the data and punches. Cached method.
229 229
      *
230
-     * @return mixed
230
+     * @return \PHPUnit_Framework_MockObject_Matcher_InvokedCount
231 231
      */
232 232
     private function getData() {
233 233
         return once(function () {
@@ -247,6 +247,9 @@  discard block
 block discarded – undo
247 247
         });
248 248
     }
249 249
 
250
+    /**
251
+     * @param string $endpoint
252
+     */
250 253
     private function buildUrl($endpoint, array $params = []) {
251 254
         return once(function () use ($endpoint, $params) {
252 255
             return vsprintf($endpoint, array_merge([static::API_BASE_URL], $params));
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
         }
177 177
         $punches = $this->getPunches($month, $year);
178 178
 
179
-        return array_filter($punches['punches'], function (\DateTime $punchDateTime) use ($day) {
179
+        return array_filter($punches['punches'], function(\DateTime $punchDateTime) use ($day) {
180 180
             return (int) $punchDateTime->format('d') === (int) $day;
181 181
         });
182 182
     }
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
      * @return mixed
234 234
      */
235 235
     private function getData() {
236
-        return once(function () {
236
+        return once(function() {
237 237
             $params = [
238 238
                 'company'   => $this->companyId,
239 239
                 'matricula' => $this->username,
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
     }
252 252
 
253 253
     private function buildUrl($endpoint, array $params = []) {
254
-        return once(function () use ($endpoint, $params) {
254
+        return once(function() use ($endpoint, $params) {
255 255
             return vsprintf($endpoint, array_merge([static::API_BASE_URL], $params));
256 256
         });
257 257
     }
@@ -277,10 +277,10 @@  discard block
 block discarded – undo
277 277
 
278 278
         foreach ($dias as $dia => $dadosDia) {
279 279
             // Parse falta
280
-            $falta = array_filter($dadosDia->resultado, function ($item) { return $item->tipo == 'FALTA'; });
280
+            $falta = array_filter($dadosDia->resultado, function($item) { return $item->tipo == 'FALTA'; });
281 281
 
282 282
             // Parse extra
283
-            $extra = array_filter($dadosDia->resultado, function ($item) { return $item->tipo == 'Extra'; });
283
+            $extra = array_filter($dadosDia->resultado, function($item) { return $item->tipo == 'Extra'; });
284 284
 
285 285
             $tmp[$dia][] = [
286 286
                 'falta' => empty($falta) ? '00:00' : preg_replace('/^(-)?(\d{2})(\d{2})$/i', '\1\2:\3', array_shift($falta)->valor),
Please login to merge, or discard this patch.
src/Adapters/GuzzleAdapter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@
 block discarded – undo
89 89
      */
90 90
     public function post($url, $data = [], array $config = [])
91 91
     {
92
-        return once(function () use ($url, $data, $config) {
92
+        return once(function() use ($url, $data, $config) {
93 93
             return $this->request(IHttpClient::HTTP_POST, $url, $data, $config);
94 94
         });
95 95
     }
Please login to merge, or discard this patch.