Test Setup Failed
Push — master ( a8ca1a...6def47 )
by William Johnson S.
02:10
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   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
         }
174 174
         $punches = $this->getPunches($month, $year);
175 175
 
176
-        return array_filter($punches['punches'], function (\DateTime $punchDateTime) use ($day) {
176
+        return array_filter($punches['punches'], function(\DateTime $punchDateTime) use ($day) {
177 177
             return (int) $punchDateTime->format('d') === (int) $day;
178 178
         });
179 179
     }
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
      * @return mixed
231 231
      */
232 232
     private function getData() {
233
-        return once(function () {
233
+        return once(function() {
234 234
             $params = [
235 235
                 'company'   => $this->companyId,
236 236
                 'matricula' => $this->username,
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
     }
249 249
 
250 250
     private function buildUrl($endpoint, array $params = []) {
251
-        return once(function () use ($endpoint, $params) {
251
+        return once(function() use ($endpoint, $params) {
252 252
             return vsprintf($endpoint, array_merge([static::API_BASE_URL], $params));
253 253
         });
254 254
     }
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.