Test Failed
Branch main (87f516)
by Åsa
11:13 queued 08:26
created
src/Weather/ApiDataProcessing.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
         $newTempArray = [];
30 30
         forEach ($dateArray as $temp) {
31 31
             $modTemp = $temp[$el1][$el2];
32
-            array_push($newTempArray, substr($modTemp,0 ,5));
32
+            array_push($newTempArray, substr($modTemp, 0, 5));
33 33
         }
34 34
         return $newTempArray;
35 35
     }
Please login to merge, or discard this patch.
src/Weather/LocationService.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
     public function curlIpApi($ipAdr): array
43 43
     {
44 44
         $curl = new CurlService();
45
-        if ($ipAdr!= "") {
45
+        if ($ipAdr != "") {
46 46
             $res = $curl->getDataThroughCurl($this->getUrl() . $ipAdr . "?access_key=" . $this->getKey());
47 47
 
48 48
             if ($res["type"] == null) {
Please login to merge, or discard this patch.
src/Weather/CurlService.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,13 +29,13 @@
 block discarded – undo
29 29
         return json_decode($data, true);
30 30
     }
31 31
 
32
-    public function getMultipleCurls ($fetchURL, $dateArray, $fetchURLPart2)
32
+    public function getMultipleCurls($fetchURL, $dateArray, $fetchURLPart2)
33 33
     {
34 34
         $mh = curl_multi_init();
35 35
         $multiCurl = [];
36 36
         $curlArray = [];
37 37
 
38
-        foreach($dateArray as $i => $date) {
38
+        foreach ($dateArray as $i => $date) {
39 39
             $URL = $fetchURL . $date . $fetchURLPart2;
40 40
             $multiCurl[$i] = curl_init();
41 41
             curl_setopt($multiCurl[$i], CURLOPT_URL, $URL);
Please login to merge, or discard this patch.
src/Weather/WeatherService.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -73,13 +73,13 @@
 block discarded – undo
73 73
         for ($x = 0; $x <= 4; $x++) {
74 74
             array_push($dateArray, $currentTime -= 86400);
75 75
         }
76
-        $res = $curl->getMultipleCurls($this->getUrl() . "/timemachine?" . "lat=" . $lat . "&lon=" . $lon . "&units=metric" . "&lang=sv" . "&dt=", $dateArray,  "&appid=" . $this->getKey());
76
+        $res = $curl->getMultipleCurls($this->getUrl() . "/timemachine?" . "lat=" . $lat . "&lon=" . $lon . "&units=metric" . "&lang=sv" . "&dt=", $dateArray, "&appid=" . $this->getKey());
77 77
         if (isset($res["cod"])) {
78 78
             return [
79 79
                 "Error" => "Väder kan inte ges för positionen. Försök igen"
80 80
             ];
81 81
         }
82
-        $json =  [
82
+        $json = [
83 83
             "Date1" => date("Y-m-d", $res[0]["current"]["dt"]),
84 84
             "CurrentTemp1" => substr($res[0]["current"]["temp"], 0, 5),
85 85
             "CurrentFeelsLike1" => substr($res[0]["current"]["feels_like"], 0, 5),
Please login to merge, or discard this patch.
config/commons.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -25,10 +25,10 @@  discard block
 block discarded – undo
25 25
 error_reporting(-1); // Report all type of errors
26 26
 //error_reporting(E_ALL ^ E_DEPRECATED);  // Report no deprecated errors
27 27
 if (constant("ANAX_DEVELOPMENT")) {
28
-    ini_set("display_errors", 1);  // Display all errors
28
+    ini_set("display_errors", 1); // Display all errors
29 29
 } elseif (constant("ANAX_PRODUCTION")) {
30
-    ini_set("display_errors", 0);  // Display no errors
31
-    ini_set("log_errors", 1);      // Log errors to file error_log
30
+    ini_set("display_errors", 0); // Display no errors
31
+    ini_set("log_errors", 1); // Log errors to file error_log
32 32
     ini_set("error_log", ANAX_INSTALL_PATH . "/log/error_log");
33 33
 }
34 34
 
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 /**
38 38
  * Default exception handler.
39 39
  */
40
-set_exception_handler(function ($e) {
40
+set_exception_handler(function($e) {
41 41
     echo "<p>Anax: Uncaught exception:</p><p>Line "
42 42
         . $e->getLine()
43 43
         . " in file "
Please login to merge, or discard this patch.
config/router/700_example.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
             "info" => "Just say hi with a string.",
14 14
             "method" => null,
15 15
             "path" => "hi",
16
-            "handler" => function () {
16
+            "handler" => function() {
17 17
                 //echo "Ho";
18 18
                 return "Hi.";
19 19
             },
Please login to merge, or discard this patch.
config/router/800_test.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -16,21 +16,21 @@  discard block
 block discarded – undo
16 16
         [
17 17
             "info" => "Just say hi with a string.",
18 18
             "path" => "hi",
19
-            "handler" => function () {
19
+            "handler" => function() {
20 20
                 return "Hi.";
21 21
             },
22 22
         ],
23 23
         [
24 24
             "info" => "Say No! with status code 500.",
25 25
             "path" => "no",
26
-            "handler" => function () {
26
+            "handler" => function() {
27 27
                 return ["No!", 500];
28 28
             },
29 29
         ],
30 30
         [
31 31
             "info" => "Say Hi through JSON.",
32 32
             "path" => "json",
33
-            "handler" => function () {
33
+            "handler" => function() {
34 34
                 return [["message" => "Hi JSON"]];
35 35
             },
36 36
         ],
@@ -47,28 +47,28 @@  discard block
 block discarded – undo
47 47
         [
48 48
             "info" => "Throw standard exception.",
49 49
             "path" => "exception",
50
-            "handler" => function () {
50
+            "handler" => function() {
51 51
                 throw new \Exception("Standard \Exception");
52 52
             },
53 53
         ],
54 54
         [
55 55
             "info" => "Try internal 403.",
56 56
             "path" => "403",
57
-            "handler" => function () {
57
+            "handler" => function() {
58 58
                 throw new ForbiddenException("Detailed error message.");
59 59
             },
60 60
         ],
61 61
         [
62 62
             "info" => "Try internal 404.",
63 63
             "path" => "404",
64
-            "handler" => function () {
64
+            "handler" => function() {
65 65
                 throw new NotFoundException("Detailed error message.");
66 66
             },
67 67
         ],
68 68
         [
69 69
             "info" => "Try internal 500.",
70 70
             "path" => "500",
71
-            "handler" => function () {
71
+            "handler" => function() {
72 72
                 throw new InternalErrorException("Detailed error message.");
73 73
             },
74 74
         ],
Please login to merge, or discard this patch.
config/di/view.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 block discarded – undo
7 7
         "view" => [
8 8
             "active" => false,
9 9
             "shared" => true,
10
-            "callback" => function () {
10
+            "callback" => function() {
11 11
                 $view = new \Anax\View\ViewCollection();
12 12
                 $view->setDI($this);
13 13
 
Please login to merge, or discard this patch.
config/di/location.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
             // Callback executed when service is activated
18 18
             // Create the service, load its configuration (if any)
19 19
             // and set it up.
20
-            "callback" => function () {
20
+            "callback" => function() {
21 21
                 $locationService = new \Asti\Weather\LocationService();
22 22
 
23 23
                 // Load the configuration files
Please login to merge, or discard this patch.