Completed
Push — master ( c16962...925f8b )
by mains
03:47 queued 25s
created
php/Requests/AbstractRequest.php 1 patch
Upper-Lower-Casing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
     const USERAGENT = 'Jodel/4.41.0 Dalvik/2.1.0 (Linux; U; Android 5.1.1; )';
9 9
     const CLIENT_TYPE = 'android_4.41.0';
10 10
     
11
-    private $accessToken = null;
11
+    private $accessToken = NULL;
12 12
     private $payLoad;
13 13
     public $expects = '';
14 14
     public $version = 'v2';
@@ -75,19 +75,19 @@  discard block
 block discarded – undo
75 75
 
76 76
         switch ($result->status_code) {
77 77
             case 200:
78
-                $result = json_decode($result->body, true);
78
+                $result = json_decode($result->body, TRUE);
79 79
                 break;
80 80
             case 204:
81 81
                 $result = 'Success';
82 82
                 http_response_code(200);
83 83
                 break;
84 84
             case 400:
85
-                $result = json_decode($result->body, true);
86
-                error_log('Error 400 - ' . print_r($result, true));
85
+                $result = json_decode($result->body, TRUE);
86
+                error_log('Error 400 - ' . print_r($result, TRUE));
87 87
                 break;
88 88
             case 401:
89 89
                 $resultOld = $result;
90
-                $result = json_decode($result->body, true);
90
+                $result = json_decode($result->body, TRUE);
91 91
 
92 92
                 if(is_array($result) && $result['error'] == 'length')
93 93
                 {
@@ -95,33 +95,33 @@  discard block
 block discarded – undo
95 95
                 }
96 96
                 else
97 97
                 {
98
-                    error_log('Error 401 - ' . print_r($resultOld, true));
98
+                    error_log('Error 401 - ' . print_r($resultOld, TRUE));
99 99
                 }
100 100
                 break;
101 101
             case 404:
102
-                error_log('Error 404 - ' . print_r($result, true));
103
-                $result = json_decode($result->body, true);
102
+                error_log('Error 404 - ' . print_r($result, TRUE));
103
+                $result = json_decode($result->body, TRUE);
104 104
                 break;
105 105
 			case 477:
106
-                $result = json_decode($result->body, true);
107
-                error_log('Error 477 - ' . print_r($result, true));
106
+                $result = json_decode($result->body, TRUE);
107
+                error_log('Error 477 - ' . print_r($result, TRUE));
108 108
                 break;
109 109
             case 429:
110
-                error_log('Error 429 - Too Many Requests' . print_r(json_decode($result->body, true), true));
110
+                error_log('Error 429 - Too Many Requests' . print_r(json_decode($result->body, TRUE), TRUE));
111 111
             	exit("Error 429: Too Many Requests");
112 112
             	break;
113 113
             case 403:
114
-                error_log('Error 403 - Access denied:' . print_r(json_decode($result->body, true), true));
115
-                $result = json_decode($result->body, true);
114
+                error_log('Error 403 - Access denied:' . print_r(json_decode($result->body, TRUE), TRUE));
115
+                $result = json_decode($result->body, TRUE);
116 116
                 break;
117 117
             case 502:
118
-                error_log('Error 502 - ' . print_r($result, true));
119
-                $result = json_decode($result->body, true);
118
+                error_log('Error 502 - ' . print_r($result, TRUE));
119
+                $result = json_decode($result->body, TRUE);
120 120
                 header('location:'.$_SERVER['PHP_SELF']);
121 121
                 break;
122 122
             case 503:
123
-                error_log('Error 503 - ' . print_r($result, true));
124
-                $result = json_decode($result->body, true);
123
+                error_log('Error 503 - ' . print_r($result, TRUE));
124
+                $result = json_decode($result->body, TRUE);
125 125
 
126 126
                 if(array_key_exists('error', $result) && $result['error'] == 'Service Unavailable')
127 127
                 {
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
                 break;
131 131
             default:
132 132
                 error_log('Error '.$result->status_code.' - unknown error');
133
-                $result = json_decode($result->body, true);
133
+                $result = json_decode($result->body, TRUE);
134 134
         }
135 135
 
136 136
         //important for account refresh
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
      */
155 155
     private function getSignHeaders()
156 156
     {
157
-			if($this->getAccessToken() == null) {
157
+			if($this->getAccessToken() == NULL) {
158 158
 				$payload_accessToken = "";
159 159
 			}
160 160
 			else {
Please login to merge, or discard this patch.