We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -41,8 +41,7 @@ discard block |
||
41 | 41 | * implementations and then consumed by the Apache_Solr_Response class which provides |
42 | 42 | * decoding |
43 | 43 | */ |
44 | -class Apache_Solr_HttpTransport_Response |
|
45 | -{ |
|
44 | +class Apache_Solr_HttpTransport_Response { |
|
46 | 45 | /** |
47 | 46 | * Status Messages indexed by Status Code |
48 | 47 | * Obtained from: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html |
@@ -109,12 +108,10 @@ discard block |
||
109 | 108 | * |
110 | 109 | * @return string |
111 | 110 | */ |
112 | - public static function getDefaultStatusMessage($statusCode) |
|
113 | - { |
|
111 | + public static function getDefaultStatusMessage($statusCode) { |
|
114 | 112 | $statusCode = (int) $statusCode; |
115 | 113 | |
116 | - if (isset(self::$_defaultStatusMessages[$statusCode])) |
|
117 | - { |
|
114 | + if (isset(self::$_defaultStatusMessages[$statusCode])) { |
|
118 | 115 | return self::$_defaultStatusMessages[$statusCode]; |
119 | 116 | } |
120 | 117 | |
@@ -163,8 +160,7 @@ discard block |
||
163 | 160 | * @param string $contentType The VALUE of the Content-Type HTTP header |
164 | 161 | * @param string $responseBody The body of the HTTP response |
165 | 162 | */ |
166 | - public function __construct($statusCode, $contentType, $responseBody) |
|
167 | - { |
|
163 | + public function __construct($statusCode, $contentType, $responseBody) { |
|
168 | 164 | // set the status code, make sure its an integer |
169 | 165 | $this->_statusCode = (int) $statusCode; |
170 | 166 | |
@@ -180,23 +176,19 @@ discard block |
||
180 | 176 | $this->_mimeType = "text/plain"; |
181 | 177 | $this->_encoding = "UTF-8"; |
182 | 178 | |
183 | - if ($contentType) |
|
184 | - { |
|
179 | + if ($contentType) { |
|
185 | 180 | // now break apart the header to see if there's character encoding |
186 | 181 | $contentTypeParts = explode(';', $contentType, 2); |
187 | 182 | |
188 | - if (isset($contentTypeParts[0])) |
|
189 | - { |
|
183 | + if (isset($contentTypeParts[0])) { |
|
190 | 184 | $this->_mimeType = trim($contentTypeParts[0]); |
191 | 185 | } |
192 | 186 | |
193 | - if (isset($contentTypeParts[1])) |
|
194 | - { |
|
187 | + if (isset($contentTypeParts[1])) { |
|
195 | 188 | // we have a second part, split it further |
196 | 189 | $contentTypeParts = explode('=', $contentTypeParts[1]); |
197 | 190 | |
198 | - if (isset($contentTypeParts[1])) |
|
199 | - { |
|
191 | + if (isset($contentTypeParts[1])) { |
|
200 | 192 | $this->_encoding = trim($contentTypeParts[1]); |
201 | 193 | } |
202 | 194 | } |
@@ -208,8 +200,7 @@ discard block |
||
208 | 200 | * |
209 | 201 | * @return integer |
210 | 202 | */ |
211 | - public function getStatusCode() |
|
212 | - { |
|
203 | + public function getStatusCode() { |
|
213 | 204 | return $this->_statusCode; |
214 | 205 | } |
215 | 206 | |
@@ -218,8 +209,7 @@ discard block |
||
218 | 209 | * |
219 | 210 | * @return string |
220 | 211 | */ |
221 | - public function getStatusMessage() |
|
222 | - { |
|
212 | + public function getStatusMessage() { |
|
223 | 213 | return $this->_statusMessage; |
224 | 214 | } |
225 | 215 | |
@@ -228,8 +218,7 @@ discard block |
||
228 | 218 | * |
229 | 219 | * @return string |
230 | 220 | */ |
231 | - public function getMimeType() |
|
232 | - { |
|
221 | + public function getMimeType() { |
|
233 | 222 | return $this->_mimeType; |
234 | 223 | } |
235 | 224 | |
@@ -238,8 +227,7 @@ discard block |
||
238 | 227 | * |
239 | 228 | * @return string |
240 | 229 | */ |
241 | - public function getEncoding() |
|
242 | - { |
|
230 | + public function getEncoding() { |
|
243 | 231 | return $this->_encoding; |
244 | 232 | } |
245 | 233 | |
@@ -248,8 +236,7 @@ discard block |
||
248 | 236 | * |
249 | 237 | * @return string |
250 | 238 | */ |
251 | - public function getBody() |
|
252 | - { |
|
239 | + public function getBody() { |
|
253 | 240 | return $this->_responseBody; |
254 | 241 | } |
255 | 242 | } |
@@ -42,8 +42,7 @@ discard block |
||
42 | 42 | /** |
43 | 43 | * A Curl based HTTP transport. Uses a single curl session for all requests. |
44 | 44 | */ |
45 | -class Apache_Solr_HttpTransport_Curl extends Apache_Solr_HttpTransport_Abstract |
|
46 | -{ |
|
45 | +class Apache_Solr_HttpTransport_Curl extends Apache_Solr_HttpTransport_Abstract { |
|
47 | 46 | /** |
48 | 47 | * SVN Revision meta data for this class |
49 | 48 | */ |
@@ -64,8 +63,7 @@ discard block |
||
64 | 63 | /** |
65 | 64 | * Initializes a curl session |
66 | 65 | */ |
67 | - public function __construct() |
|
68 | - { |
|
66 | + public function __construct() { |
|
69 | 67 | // initialize a CURL session |
70 | 68 | $this->_curl = curl_init(); |
71 | 69 | |
@@ -85,17 +83,14 @@ discard block |
||
85 | 83 | /** |
86 | 84 | * Closes a curl session |
87 | 85 | */ |
88 | - function __destruct() |
|
89 | - { |
|
86 | + function __destruct() { |
|
90 | 87 | // close our curl session |
91 | 88 | curl_close($this->_curl); |
92 | 89 | } |
93 | 90 | |
94 | - public function performGetRequest($url, $timeout = false) |
|
95 | - { |
|
91 | + public function performGetRequest($url, $timeout = false) { |
|
96 | 92 | // check the timeout value |
97 | - if ($timeout === false || $timeout <= 0.0) |
|
98 | - { |
|
93 | + if ($timeout === false || $timeout <= 0.0) { |
|
99 | 94 | // use the default timeout |
100 | 95 | $timeout = $this->getDefaultTimeout(); |
101 | 96 | } |
@@ -125,11 +120,9 @@ discard block |
||
125 | 120 | return new Apache_Solr_HttpTransport_Response($statusCode, $contentType, $responseBody); |
126 | 121 | } |
127 | 122 | |
128 | - public function performHeadRequest($url, $timeout = false) |
|
129 | - { |
|
123 | + public function performHeadRequest($url, $timeout = false) { |
|
130 | 124 | // check the timeout value |
131 | - if ($timeout === false || $timeout <= 0.0) |
|
132 | - { |
|
125 | + if ($timeout === false || $timeout <= 0.0) { |
|
133 | 126 | // use the default timeout |
134 | 127 | $timeout = $this->getDefaultTimeout(); |
135 | 128 | } |
@@ -156,11 +149,9 @@ discard block |
||
156 | 149 | return new Apache_Solr_HttpTransport_Response($statusCode, $contentType, $responseBody); |
157 | 150 | } |
158 | 151 | |
159 | - public function performPostRequest($url, $postData, $contentType, $timeout = false) |
|
160 | - { |
|
152 | + public function performPostRequest($url, $postData, $contentType, $timeout = false) { |
|
161 | 153 | // check the timeout value |
162 | - if ($timeout === false || $timeout <= 0.0) |
|
163 | - { |
|
154 | + if ($timeout === false || $timeout <= 0.0) { |
|
164 | 155 | // use the default timeout |
165 | 156 | $timeout = $this->getDefaultTimeout(); |
166 | 157 | } |
@@ -44,8 +44,7 @@ discard block |
||
44 | 44 | * every request. This isn't the recommended way to use curl, but some version of |
45 | 45 | * PHP have memory issues. |
46 | 46 | */ |
47 | -class Apache_Solr_HttpTransport_CurlNoReuse extends Apache_Solr_HttpTransport_Abstract |
|
48 | -{ |
|
47 | +class Apache_Solr_HttpTransport_CurlNoReuse extends Apache_Solr_HttpTransport_Abstract { |
|
49 | 48 | /** |
50 | 49 | * SVN Revision meta data for this class |
51 | 50 | */ |
@@ -56,11 +55,9 @@ discard block |
||
56 | 55 | */ |
57 | 56 | const SVN_ID = '$Id:$'; |
58 | 57 | |
59 | - public function performGetRequest($url, $timeout = false) |
|
60 | - { |
|
58 | + public function performGetRequest($url, $timeout = false) { |
|
61 | 59 | // check the timeout value |
62 | - if ($timeout === false || $timeout <= 0.0) |
|
63 | - { |
|
60 | + if ($timeout === false || $timeout <= 0.0) { |
|
64 | 61 | // use the default timeout |
65 | 62 | $timeout = $this->getDefaultTimeout(); |
66 | 63 | } |
@@ -98,11 +95,9 @@ discard block |
||
98 | 95 | return new Apache_Solr_HttpTransport_Response($statusCode, $contentType, $responseBody); |
99 | 96 | } |
100 | 97 | |
101 | - public function performHeadRequest($url, $timeout = false) |
|
102 | - { |
|
98 | + public function performHeadRequest($url, $timeout = false) { |
|
103 | 99 | // check the timeout value |
104 | - if ($timeout === false || $timeout <= 0.0) |
|
105 | - { |
|
100 | + if ($timeout === false || $timeout <= 0.0) { |
|
106 | 101 | // use the default timeout |
107 | 102 | $timeout = $this->getDefaultTimeout(); |
108 | 103 | } |
@@ -143,11 +138,9 @@ discard block |
||
143 | 138 | return new Apache_Solr_HttpTransport_Response($statusCode, $contentType, $responseBody); |
144 | 139 | } |
145 | 140 | |
146 | - public function performPostRequest($url, $postData, $contentType, $timeout = false) |
|
147 | - { |
|
141 | + public function performPostRequest($url, $postData, $contentType, $timeout = false) { |
|
148 | 142 | // check the timeout value |
149 | - if ($timeout === false || $timeout <= 0.0) |
|
150 | - { |
|
143 | + if ($timeout === false || $timeout <= 0.0) { |
|
151 | 144 | // use the default timeout |
152 | 145 | $timeout = $this->getDefaultTimeout(); |
153 | 146 | } |
@@ -40,8 +40,7 @@ discard block |
||
40 | 40 | * Convenience class that implements the transport implementation. Can be extended by |
41 | 41 | * real implementations to do some of the common book keeping |
42 | 42 | */ |
43 | -abstract class Apache_Solr_HttpTransport_Abstract implements Apache_Solr_HttpTransport_Interface |
|
44 | -{ |
|
43 | +abstract class Apache_Solr_HttpTransport_Abstract implements Apache_Solr_HttpTransport_Interface { |
|
45 | 44 | /** |
46 | 45 | * Our default timeout value for requests that don't specify a timeout |
47 | 46 | * |
@@ -55,16 +54,13 @@ discard block |
||
55 | 54 | * |
56 | 55 | * @return float |
57 | 56 | */ |
58 | - public function getDefaultTimeout() |
|
59 | - { |
|
57 | + public function getDefaultTimeout() { |
|
60 | 58 | // lazy load the default timeout from the ini settings |
61 | - if ($this->_defaultTimeout === false) |
|
62 | - { |
|
59 | + if ($this->_defaultTimeout === false) { |
|
63 | 60 | $this->_defaultTimeout = (int) ini_get('default_socket_timeout'); |
64 | 61 | |
65 | 62 | // double check we didn't get 0 for a timeout |
66 | - if ($this->_defaultTimeout <= 0) |
|
67 | - { |
|
63 | + if ($this->_defaultTimeout <= 0) { |
|
68 | 64 | $this->_defaultTimeout = 60; |
69 | 65 | } |
70 | 66 | } |
@@ -77,12 +73,10 @@ discard block |
||
77 | 73 | * |
78 | 74 | * @param float $timeout |
79 | 75 | */ |
80 | - public function setDefaultTimeout($timeout) |
|
81 | - { |
|
76 | + public function setDefaultTimeout($timeout) { |
|
82 | 77 | $timeout = (float) $timeout; |
83 | 78 | |
84 | - if ($timeout >= 0) |
|
85 | - { |
|
79 | + if ($timeout >= 0) { |
|
86 | 80 | $this->_defaultTimeout = $timeout; |
87 | 81 | } |
88 | 82 | } |
@@ -42,8 +42,7 @@ discard block |
||
42 | 42 | /** |
43 | 43 | * HTTP Transport implemenation that uses the builtin http URL wrappers and file_get_contents |
44 | 44 | */ |
45 | -class Apache_Solr_HttpTransport_FileGetContents extends Apache_Solr_HttpTransport_Abstract |
|
46 | -{ |
|
45 | +class Apache_Solr_HttpTransport_FileGetContents extends Apache_Solr_HttpTransport_Abstract { |
|
47 | 46 | /** |
48 | 47 | * SVN Revision meta data for this class |
49 | 48 | */ |
@@ -64,26 +63,21 @@ discard block |
||
64 | 63 | /** |
65 | 64 | * Initializes our reuseable get and post stream contexts |
66 | 65 | */ |
67 | - public function __construct() |
|
68 | - { |
|
66 | + public function __construct() { |
|
69 | 67 | $this->_getContext = stream_context_create(); |
70 | 68 | $this->_headContext = stream_context_create(); |
71 | 69 | $this->_postContext = stream_context_create(); |
72 | 70 | } |
73 | 71 | |
74 | - public function performGetRequest($url, $timeout = false) |
|
75 | - { |
|
72 | + public function performGetRequest($url, $timeout = false) { |
|
76 | 73 | // set the timeout if specified |
77 | - if ($timeout !== FALSE && $timeout > 0.0) |
|
78 | - { |
|
74 | + if ($timeout !== FALSE && $timeout > 0.0) { |
|
79 | 75 | // timeouts with file_get_contents seem to need |
80 | 76 | // to be halved to work as expected |
81 | 77 | $timeout = (float) $timeout / 2; |
82 | 78 | |
83 | 79 | stream_context_set_option($this->_getContext, 'http', 'timeout', $timeout); |
84 | - } |
|
85 | - else |
|
86 | - { |
|
80 | + } else { |
|
87 | 81 | // use the default timeout pulled from default_socket_timeout otherwise |
88 | 82 | stream_context_set_option($this->_getContext, 'http', 'timeout', $this->getDefaultTimeout()); |
89 | 83 | } |
@@ -97,8 +91,7 @@ discard block |
||
97 | 91 | return $this->_getResponseFromParts($responseBody, $http_response_header); |
98 | 92 | } |
99 | 93 | |
100 | - public function performHeadRequest($url, $timeout = false) |
|
101 | - { |
|
94 | + public function performHeadRequest($url, $timeout = false) { |
|
102 | 95 | stream_context_set_option($this->_headContext, array( |
103 | 96 | 'http' => array( |
104 | 97 | // set HTTP method |
@@ -111,8 +104,7 @@ discard block |
||
111 | 104 | ); |
112 | 105 | |
113 | 106 | // set the timeout if specified |
114 | - if ($timeout !== FALSE && $timeout > 0.0) |
|
115 | - { |
|
107 | + if ($timeout !== FALSE && $timeout > 0.0) { |
|
116 | 108 | // timeouts with file_get_contents seem to need |
117 | 109 | // to be halved to work as expected |
118 | 110 | $timeout = (float) $timeout / 2; |
@@ -129,8 +121,7 @@ discard block |
||
129 | 121 | return $this->_getResponseFromParts($responseBody, $http_response_header); |
130 | 122 | } |
131 | 123 | |
132 | - public function performPostRequest($url, $rawPost, $contentType, $timeout = false) |
|
133 | - { |
|
124 | + public function performPostRequest($url, $rawPost, $contentType, $timeout = false) { |
|
134 | 125 | stream_context_set_option($this->_postContext, array( |
135 | 126 | 'http' => array( |
136 | 127 | // set HTTP method |
@@ -149,8 +140,7 @@ discard block |
||
149 | 140 | ); |
150 | 141 | |
151 | 142 | // set the timeout if specified |
152 | - if ($timeout !== FALSE && $timeout > 0.0) |
|
153 | - { |
|
143 | + if ($timeout !== FALSE && $timeout > 0.0) { |
|
154 | 144 | // timeouts with file_get_contents seem to need |
155 | 145 | // to be halved to work as expected |
156 | 146 | $timeout = (float) $timeout / 2; |
@@ -170,15 +160,13 @@ discard block |
||
170 | 160 | return $this->_getResponseFromParts($responseBody, $http_response_header); |
171 | 161 | } |
172 | 162 | |
173 | - private function _getResponseFromParts($rawResponse, $httpHeaders) |
|
174 | - { |
|
163 | + private function _getResponseFromParts($rawResponse, $httpHeaders) { |
|
175 | 164 | //Assume 0, false as defaults |
176 | 165 | $status = 0; |
177 | 166 | $contentType = false; |
178 | 167 | |
179 | 168 | //iterate through headers for real status, type, and encoding |
180 | - if (is_array($httpHeaders) && count($httpHeaders) > 0) |
|
181 | - { |
|
169 | + if (is_array($httpHeaders) && count($httpHeaders) > 0) { |
|
182 | 170 | //look at the first headers for the HTTP status code |
183 | 171 | //and message (errors are usually returned this way) |
184 | 172 | // |
@@ -189,8 +177,7 @@ discard block |
||
189 | 177 | //the spec: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.1 |
190 | 178 | // |
191 | 179 | //Thanks to Daniel Andersson for pointing out this oversight |
192 | - while (isset($httpHeaders[0]) && substr($httpHeaders[0], 0, 4) == 'HTTP') |
|
193 | - { |
|
180 | + while (isset($httpHeaders[0]) && substr($httpHeaders[0], 0, 4) == 'HTTP') { |
|
194 | 181 | // we can do a intval on status line without the "HTTP/1.X " to get the code |
195 | 182 | $status = intval(substr($httpHeaders[0], 9)); |
196 | 183 | |
@@ -200,11 +187,9 @@ discard block |
||
200 | 187 | |
201 | 188 | //Look for the Content-Type response header and determine type |
202 | 189 | //and encoding from it (if possible - such as 'Content-Type: text/plain; charset=UTF-8') |
203 | - foreach ($httpHeaders as $header) |
|
204 | - { |
|
190 | + foreach ($httpHeaders as $header) { |
|
205 | 191 | // look for the header that starts appropriately |
206 | - if (strncasecmp($header, 'Content-Type:', 13) == 0) |
|
207 | - { |
|
192 | + if (strncasecmp($header, 'Content-Type:', 13) == 0) { |
|
208 | 193 | $contentType = substr($header, 13); |
209 | 194 | break; |
210 | 195 | } |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | |
217 | 217 | $mailForm .= '<option value="">'.$this->pi_getLL('chooseMail', '', TRUE).'</option>'; |
218 | 218 | |
219 | - while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($resultMail)){ |
|
219 | + while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($resultMail)) { |
|
220 | 220 | |
221 | 221 | $mails[] = $row; |
222 | 222 | |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | |
262 | 262 | $printForm .= '<option value="">'.$this->pi_getLL('choosePrinter', '', TRUE).'</option>'; |
263 | 263 | |
264 | - while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($resultPrinter)){ |
|
264 | + while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($resultPrinter)) { |
|
265 | 265 | |
266 | 266 | $printers[] = $row; |
267 | 267 |
@@ -9,7 +9,9 @@ |
||
9 | 9 | * LICENSE.txt file that was distributed with this source code. |
10 | 10 | */ |
11 | 11 | |
12 | -if (!defined ('TYPO3_MODE')) die ('Access denied.'); |
|
12 | +if (!defined ('TYPO3_MODE')) { |
|
13 | + die ('Access denied.'); |
|
14 | +} |
|
13 | 15 | |
14 | 16 | // Register plugins. |
15 | 17 | \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPItoST43($_EXTKEY, 'plugins/audioplayer/class.tx_dlf_audioplayer.php', '_audioplayer', 'list_type', TRUE); |
@@ -9,7 +9,9 @@ discard block |
||
9 | 9 | * LICENSE.txt file that was distributed with this source code. |
10 | 10 | */ |
11 | 11 | |
12 | -if (!defined ('TYPO3_MODE')) die ('Access denied.'); |
|
12 | +if (!defined ('TYPO3_MODE')) { |
|
13 | + die ('Access denied.'); |
|
14 | +} |
|
13 | 15 | |
14 | 16 | // Register static typoscript. |
15 | 17 | \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile($_EXTKEY, 'Configuration/TypoScript/', 'Basic Configuration'); |
@@ -163,16 +165,16 @@ discard block |
||
163 | 165 | \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue($_EXTKEY.'_validator', 'FILE:EXT:'.$_EXTKEY.'/plugins/validator/flexform.xml'); |
164 | 166 | |
165 | 167 | // Register modules. |
166 | -if (TYPO3_MODE == 'BE') { |
|
168 | +if (TYPO3_MODE == 'BE') { |
|
167 | 169 | |
168 | 170 | // Add modules after "web". |
169 | - if (!isset($TBE_MODULES['txdlfmodules'])) { |
|
171 | + if (!isset($TBE_MODULES['txdlfmodules'])) { |
|
170 | 172 | |
171 | 173 | $modules = array(); |
172 | 174 | |
173 | - foreach($TBE_MODULES as $key => $val) { |
|
175 | + foreach($TBE_MODULES as $key => $val) { |
|
174 | 176 | |
175 | - if ($key == 'web') { |
|
177 | + if ($key == 'web') { |
|
176 | 178 | |
177 | 179 | $modules[$key] = $val; |
178 | 180 |
@@ -927,7 +927,7 @@ |
||
927 | 927 | |
928 | 928 | foreach($this->physicalStructureInfo as $page) { |
929 | 929 | |
930 | - if(strpos($page['orderlabel'], $logicalPage) !== false){ |
|
930 | + if(strpos($page['orderlabel'], $logicalPage) !== false) { |
|
931 | 931 | |
932 | 932 | $this->lastSearchedPhysicalPage['logicalPage'] = $logicalPage; |
933 | 933 | $this->lastSearchedPhysicalPage['physicalPage'] = $physicalPage; |