Completed
Push — master ( 925f8b...411610 )
by mains
03:48
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,15 +75,15 @@  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
 
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
                 }
94 94
                 else
95 95
                 {
96
-                    $result = json_decode($result->body, true);
96
+                    $result = json_decode($result->body, TRUE);
97 97
 
98 98
                     if(is_array($result) && $result['error'] == 'length')
99 99
                     {
@@ -101,36 +101,36 @@  discard block
 block discarded – undo
101 101
                     }
102 102
                     else
103 103
                     {
104
-                        error_log('Error 401 - ' . print_r($result, true));
104
+                        error_log('Error 401 - ' . print_r($result, TRUE));
105 105
                     }
106 106
                 }
107 107
 
108 108
 
109 109
                 break;
110 110
             case 404:
111
-                error_log('Error 404 - ' . print_r($result, true));
112
-                $result = json_decode($result->body, true);
111
+                error_log('Error 404 - ' . print_r($result, TRUE));
112
+                $result = json_decode($result->body, TRUE);
113 113
                 break;
114 114
 			case 477:
115
-                $result = json_decode($result->body, true);
116
-                error_log('Error 477 - ' . print_r($result, true));
115
+                $result = json_decode($result->body, TRUE);
116
+                error_log('Error 477 - ' . print_r($result, TRUE));
117 117
                 break;
118 118
             case 429:
119
-                error_log('Error 429 - Too Many Requests' . print_r(json_decode($result->body, true), true));
119
+                error_log('Error 429 - Too Many Requests' . print_r(json_decode($result->body, TRUE), TRUE));
120 120
             	exit("Error 429: Too Many Requests");
121 121
             	break;
122 122
             case 403:
123
-                error_log('Error 403 - Access denied:' . print_r(json_decode($result->body, true), true));
124
-                $result = json_decode($result->body, true);
123
+                error_log('Error 403 - Access denied:' . print_r(json_decode($result->body, TRUE), TRUE));
124
+                $result = json_decode($result->body, TRUE);
125 125
                 break;
126 126
             case 502:
127
-                error_log('Error 502 - ' . print_r($result, true));
128
-                $result = json_decode($result->body, true);
127
+                error_log('Error 502 - ' . print_r($result, TRUE));
128
+                $result = json_decode($result->body, TRUE);
129 129
                 header('location:'.$_SERVER['PHP_SELF']);
130 130
                 break;
131 131
             case 503:
132
-                error_log('Error 503 - ' . print_r($result, true));
133
-                $result = json_decode($result->body, true);
132
+                error_log('Error 503 - ' . print_r($result, TRUE));
133
+                $result = json_decode($result->body, TRUE);
134 134
 
135 135
                 if(array_key_exists('error', $result) && $result['error'] == 'Service Unavailable')
136 136
                 {
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
                 break;
140 140
             default:
141 141
                 error_log('Error '.$result->status_code.' - unknown error');
142
-                $result = json_decode($result->body, true);
142
+                $result = json_decode($result->body, TRUE);
143 143
         }
144 144
 
145 145
         //important for account refresh
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
      */
164 164
     private function getSignHeaders()
165 165
     {
166
-			if($this->getAccessToken() == null) {
166
+			if($this->getAccessToken() == NULL) {
167 167
 				$payload_accessToken = "";
168 168
 			}
169 169
 			else {
Please login to merge, or discard this patch.