@@ -22,7 +22,7 @@ |
||
| 22 | 22 | // Build a SoqlQuery with functions |
| 23 | 23 | $soql = new SoqlQuery(); |
| 24 | 24 | $soql->where("within_circle(incident_location, {$_POST['latitude']}, {$_POST['longitude']}, {$_POST['range']})") |
| 25 | - ->limit(20); |
|
| 25 | + ->limit(20); |
|
| 26 | 26 | |
| 27 | 27 | // Get the dataset. $results is now an associative array in the same format as the JSON object |
| 28 | 28 | $results = $ds->getDataset($soql); |
@@ -67,7 +67,7 @@ |
||
| 67 | 67 | </tr> |
| 68 | 68 | |
| 69 | 69 | <?php // Loop through all of the results from the dataset ?> |
| 70 | - <?php foreach($results as $row) { ?> |
|
| 70 | + <?php foreach ($results as $row) { ?> |
|
| 71 | 71 | <tr> |
| 72 | 72 | <?php $timestamp = new DateTime($row["event_clearance_date"]); ?> |
| 73 | 73 | <td><?= $timestamp->format('Y-m-d h:ia') ?></td> |
@@ -37,7 +37,9 @@ discard block |
||
| 37 | 37 | <body> |
| 38 | 38 | <h1>Seattle Police Department 911 Incident Response</h1> |
| 39 | 39 | |
| 40 | - <?php if (!$postBack) { ?> |
|
| 40 | + <?php if (!$postBack) |
|
| 41 | +{ |
|
| 42 | +?> |
|
| 41 | 43 | <form method="POST"> |
| 42 | 44 | <p>Query for all of the Seattle Fire 911 Calls calls within 500 meters of the Socrata offices in Seattle:</p> |
| 43 | 45 | <p>Try 47.59815, -122.334540 with a range of 500 meters</p> |
@@ -56,7 +58,10 @@ discard block |
||
| 56 | 58 | |
| 57 | 59 | <input type="submit" value="Submit"/> |
| 58 | 60 | </form> |
| 59 | - <?php } else { ?> |
|
| 61 | + <?php } |
|
| 62 | +else |
|
| 63 | +{ |
|
| 64 | +?> |
|
| 60 | 65 | <h2>Results</h2> |
| 61 | 66 | |
| 62 | 67 | <?php // Create a table for our actual data ?> |
@@ -67,7 +72,9 @@ discard block |
||
| 67 | 72 | </tr> |
| 68 | 73 | |
| 69 | 74 | <?php // Loop through all of the results from the dataset ?> |
| 70 | - <?php foreach($results as $row) { ?> |
|
| 75 | + <?php foreach($results as $row) |
|
| 76 | +{ |
|
| 77 | +?> |
|
| 71 | 78 | <tr> |
| 72 | 79 | <?php $timestamp = new DateTime($row["event_clearance_date"]); ?> |
| 73 | 80 | <td><?= $timestamp->format('Y-m-d h:ia') ?></td> |
@@ -272,9 +272,9 @@ |
||
| 272 | 272 | * |
| 273 | 273 | * @return string The API URL |
| 274 | 274 | */ |
| 275 | - private function buildApiUrl ($location, $identifier = NULL) |
|
| 275 | + private function buildApiUrl ($location, $identifier = null) |
|
| 276 | 276 | { |
| 277 | - if ($identifier === NULL) |
|
| 277 | + if ($identifier === null) |
|
| 278 | 278 | { |
| 279 | 279 | $identifier = $this->resourceId; |
| 280 | 280 | } |
@@ -340,7 +340,7 @@ |
||
| 340 | 340 | $headers = array(); |
| 341 | 341 | |
| 342 | 342 | // For a single row, the format is the `resourceID/rowID.json`, so we'll use that as the "location" of the Api URL |
| 343 | - $apiEndPoint = $this->buildApiUrl("resource", $this->resourceId . "/" . $rowID); |
|
| 343 | + $apiEndPoint = $this->buildApiUrl("resource", $this->resourceId."/".$rowID); |
|
| 344 | 344 | |
| 345 | 345 | $urlQuery = new UrlQuery($apiEndPoint, $this->sodaClient->getToken(), $this->sodaClient->getEmail(), $this->sodaClient->getPassword()); |
| 346 | 346 | $urlQuery->setOAuth2Token($this->sodaClient->getOAuth2Token()); |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | /** |
| 21 | 21 | * The ascending clause Socrata expects |
| 22 | 22 | */ |
| 23 | - const ASC = 'ASC'; |
|
| 23 | + const ASC = 'ASC'; |
|
| 24 | 24 | |
| 25 | 25 | /** |
| 26 | 26 | * The descending clause Socrata expects |
@@ -90,10 +90,10 @@ |
||
| 90 | 90 | |
| 91 | 91 | // Build up the headers we'll need to pass |
| 92 | 92 | $this->headers = array( |
| 93 | - 'Accept: application/json', |
|
| 94 | - 'Content-type: application/json', |
|
| 95 | - 'X-App-Token: ' . $this->token |
|
| 96 | - ); |
|
| 93 | + 'Accept: application/json', |
|
| 94 | + 'Content-type: application/json', |
|
| 95 | + 'X-App-Token: ' . $this->token |
|
| 96 | + ); |
|
| 97 | 97 | |
| 98 | 98 | $this->configureCurl($email, $password); |
| 99 | 99 | } |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | * |
| 138 | 138 | * @return mixed An associative array matching the returned JSON result or an StdClass object |
| 139 | 139 | */ |
| 140 | - public function sendGet ($params, $associativeArray, &$headers = NULL) |
|
| 140 | + public function sendGet ($params, $associativeArray, &$headers = null) |
|
| 141 | 141 | { |
| 142 | 142 | if (is_array($params)) |
| 143 | 143 | { |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | * |
| 173 | 173 | * @return mixed An associative array matching the returned JSON result or an StdClass object |
| 174 | 174 | */ |
| 175 | - public function sendPost ($dataAsJson, $associativeArray, &$headers = NULL) |
|
| 175 | + public function sendPost ($dataAsJson, $associativeArray, &$headers = null) |
|
| 176 | 176 | { |
| 177 | 177 | $this->setPostFields($dataAsJson); |
| 178 | 178 | |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | * |
| 199 | 199 | * @return mixed An associative array matching the returned JSON result or an StdClass object |
| 200 | 200 | */ |
| 201 | - public function sendPut ($dataAsJson, $associativeArray, &$headers = NULL) |
|
| 201 | + public function sendPut ($dataAsJson, $associativeArray, &$headers = null) |
|
| 202 | 202 | { |
| 203 | 203 | $this->setPostFields($dataAsJson); |
| 204 | 204 | |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | * |
| 221 | 221 | * @return mixed An associative array matching the returned JSON result or an StdClass object |
| 222 | 222 | */ |
| 223 | - public function sendDelete ($associativeArray, &$headers = NULL) |
|
| 223 | + public function sendDelete ($associativeArray, &$headers = null) |
|
| 224 | 224 | { |
| 225 | 225 | curl_setopt($this->cURL, CURLOPT_CUSTOMREQUEST, "DELETE"); |
| 226 | 226 | |
@@ -266,7 +266,7 @@ discard block |
||
| 266 | 266 | |
| 267 | 267 | if ($ignoreReturn) |
| 268 | 268 | { |
| 269 | - return NULL; |
|
| 269 | + return null; |
|
| 270 | 270 | } |
| 271 | 271 | |
| 272 | 272 | $resultArray = $this->handleResponseBody($body, $result); |
@@ -365,7 +365,7 @@ discard block |
||
| 365 | 365 | */ |
| 366 | 366 | private function saveHeaders ($header, &$headers) |
| 367 | 367 | { |
| 368 | - if ($headers === NULL) |
|
| 368 | + if ($headers === null) |
|
| 369 | 369 | { |
| 370 | 370 | return; |
| 371 | 371 | } |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | $this->headers = array( |
| 93 | 93 | 'Accept: application/json', |
| 94 | 94 | 'Content-type: application/json', |
| 95 | - 'X-App-Token: ' . $this->token |
|
| 95 | + 'X-App-Token: '.$this->token |
|
| 96 | 96 | ); |
| 97 | 97 | |
| 98 | 98 | $this->configureCurl($email, $password); |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | if (!StringUtilities::isNullOrEmpty($token)) |
| 120 | 120 | { |
| 121 | 121 | $this->oAuth2Token = $token; |
| 122 | - $this->headers[] = "Authorization: OAuth " . $this->oAuth2Token; |
|
| 122 | + $this->headers[] = "Authorization: OAuth ".$this->oAuth2Token; |
|
| 123 | 123 | } |
| 124 | 124 | } |
| 125 | 125 | |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | } |
| 147 | 147 | else if (!empty($params)) |
| 148 | 148 | { |
| 149 | - $full_url = $this->url . "?" . $params; |
|
| 149 | + $full_url = $this->url."?".$params; |
|
| 150 | 150 | } |
| 151 | 151 | else |
| 152 | 152 | { |
@@ -295,7 +295,7 @@ discard block |
||
| 295 | 295 | { |
| 296 | 296 | curl_setopt_array($this->cURL, array( |
| 297 | 297 | CURLOPT_HTTPAUTH => CURLAUTH_BASIC, |
| 298 | - CURLOPT_USERPWD => $email . ":" . $password |
|
| 298 | + CURLOPT_USERPWD => $email.":".$password |
|
| 299 | 299 | )); |
| 300 | 300 | } |
| 301 | 301 | } |
@@ -398,7 +398,7 @@ discard block |
||
| 398 | 398 | |
| 399 | 399 | if (count($params) > 0) |
| 400 | 400 | { |
| 401 | - $full_url .= "?" . implode("&", $params); |
|
| 401 | + $full_url .= "?".implode("&", $params); |
|
| 402 | 402 | } |
| 403 | 403 | |
| 404 | 404 | return $full_url; |
@@ -435,7 +435,7 @@ discard block |
||
| 435 | 435 | |
| 436 | 436 | foreach ($params as $key => $value) |
| 437 | 437 | { |
| 438 | - $parameters[] = rawurlencode($key) . "=" . rawurlencode($value); |
|
| 438 | + $parameters[] = rawurlencode($key)."=".rawurlencode($value); |
|
| 439 | 439 | } |
| 440 | 440 | |
| 441 | 441 | return $parameters; |
@@ -87,7 +87,9 @@ |
||
| 87 | 87 | * |
| 88 | 88 | * @since 0.1.0 |
| 89 | 89 | */ |
| 90 | - public function __construct () {} |
|
| 90 | + public function __construct () |
|
| 91 | + { |
|
| 92 | +} |
|
| 91 | 93 | |
| 92 | 94 | /** |
| 93 | 95 | * Convert the current information into a URL encoded query that can be appended to the domain |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | |
| 167 | 167 | foreach ($array as $key => $value) |
| 168 | 168 | { |
| 169 | - if(is_string($key) && !is_null($value)) |
|
| 169 | + if (is_string($key) && !is_null($value)) |
|
| 170 | 170 | { |
| 171 | 171 | $formattedValues[] = rawurlencode(sprintf($format, trim($key), trim($value))); |
| 172 | 172 | } |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | */ |
| 244 | 244 | public function order ($column, $direction = self::DEFAULT_ORDER_DIRECTION) |
| 245 | 245 | { |
| 246 | - $this->queryElements[self::ORDER_KEY][] = rawurlencode($column . " " . $direction); |
|
| 246 | + $this->queryElements[self::ORDER_KEY][] = rawurlencode($column." ".$direction); |
|
| 247 | 247 | |
| 248 | 248 | return $this; |
| 249 | 249 | } |
@@ -26,6 +26,6 @@ |
||
| 26 | 26 | */ |
| 27 | 27 | public function __construct ($filename) |
| 28 | 28 | { |
| 29 | - $this->message = "The following file could not be found or opened: " . $filename; |
|
| 29 | + $this->message = "The following file could not be found or opened: ".$filename; |
|
| 30 | 30 | } |
| 31 | 31 | } |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -require_once __DIR__ . '/ApiFilter.php'; |
|
| 3 | +require_once __DIR__.'/ApiFilter.php'; |
|
| 4 | 4 | |
| 5 | 5 | use allejo\Sami\ApiFilter; |
| 6 | 6 | use Sami\RemoteRepository\GitHubRemoteRepository; |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | $iterator = Finder::create() |
| 12 | 12 | ->files() |
| 13 | 13 | ->name('*.php') |
| 14 | - ->in($dir = __DIR__ . '/../src') |
|
| 14 | + ->in($dir = __DIR__.'/../src') |
|
| 15 | 15 | ; |
| 16 | 16 | |
| 17 | 17 | // generate documentation for all 0.* branches and the master branch |
@@ -24,8 +24,8 @@ discard block |
||
| 24 | 24 | $sami = new Sami($iterator, array( |
| 25 | 25 | 'versions' => $versions, |
| 26 | 26 | 'title' => 'PhpSoda API', |
| 27 | - 'build_dir' => __DIR__ . '/api/build/PhpSoda/%version%', |
|
| 28 | - 'cache_dir' => __DIR__ . '/api/cache/PhpSoda/%version%', |
|
| 27 | + 'build_dir' => __DIR__.'/api/build/PhpSoda/%version%', |
|
| 28 | + 'cache_dir' => __DIR__.'/api/cache/PhpSoda/%version%', |
|
| 29 | 29 | 'remote_repository' => new GitHubRemoteRepository('allejo/PhpSoda', dirname($dir)), |
| 30 | 30 | 'default_opened_level' => 2, |
| 31 | 31 | )); |
@@ -34,7 +34,8 @@ |
||
| 34 | 34 | * Include this section if you want sami to document |
| 35 | 35 | * private and protected functions/properties |
| 36 | 36 | */ |
| 37 | -$sami['filter'] = function () { |
|
| 37 | +$sami['filter'] = function () |
|
| 38 | +{ |
|
| 38 | 39 | return new ApiFilter(); |
| 39 | 40 | }; |
| 40 | 41 | |