@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | |
3 | 3 | // Next line will load dependencies to run this example |
4 | 4 | // Please refer to the README how to use in your project |
5 | -require_once __DIR__ . '/../../sendgrid-php.php'; |
|
5 | +require_once __DIR__.'/../../sendgrid-php.php'; |
|
6 | 6 | |
7 | 7 | $apiKey = getenv('SENDGRID_API_KEY'); |
8 | 8 | $sg = new \SendGrid($apiKey); |
@@ -13,9 +13,9 @@ discard block |
||
13 | 13 | |
14 | 14 | try { |
15 | 15 | $response = $sg->client->scopes()->get(); |
16 | - print $response->statusCode() . "\n"; |
|
16 | + print $response->statusCode()."\n"; |
|
17 | 17 | print_r($response->headers()); |
18 | - print $response->body() . "\n"; |
|
18 | + print $response->body()."\n"; |
|
19 | 19 | } catch (Exception $e) { |
20 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
20 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
21 | 21 | } |
@@ -352,10 +352,10 @@ discard block |
||
352 | 352 | */ |
353 | 353 | private function buildUrl($queryParams = null) |
354 | 354 | { |
355 | - $path = '/' . implode('/', $this->path); |
|
355 | + $path = '/'.implode('/', $this->path); |
|
356 | 356 | if (isset($queryParams)) { |
357 | 357 | // Regex replaces `[0]=`, `[1]=`, etc. with `=`. |
358 | - $path .= '?' . preg_replace('/%5B(?:\d|[1-9]\d+)%5D=/', '=', http_build_query($queryParams)); |
|
358 | + $path .= '?'.preg_replace('/%5B(?:\d|[1-9]\d+)%5D=/', '=', http_build_query($queryParams)); |
|
359 | 359 | } |
360 | 360 | |
361 | 361 | return sprintf('%s%s%s', $this->host, $this->version ?: '', $path); |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | |
384 | 384 | if (isset($headers)) { |
385 | 385 | $headers = array_merge($this->headers, $headers); |
386 | - } else { |
|
386 | + }else { |
|
387 | 387 | $headers = $this->headers; |
388 | 388 | } |
389 | 389 | |
@@ -398,7 +398,7 @@ discard block |
||
398 | 398 | $caPathOrFile = \Composer\CaBundle\CaBundle::getSystemCaRootBundlePath(); |
399 | 399 | if (is_dir($caPathOrFile) || (is_link($caPathOrFile) && is_dir(readlink($caPathOrFile)))) { |
400 | 400 | $options[CURLOPT_CAPATH] = $caPathOrFile; |
401 | - } else { |
|
401 | + }else { |
|
402 | 402 | $options[CURLOPT_CAINFO] = $caPathOrFile; |
403 | 403 | } |
404 | 404 | } |
@@ -565,7 +565,7 @@ discard block |
||
565 | 565 | 'headers' => $headers, |
566 | 566 | ]; |
567 | 567 | $retryRequests[] = $this->createSavedRequest($requestData, false); |
568 | - } else { |
|
568 | + }else { |
|
569 | 569 | $responses[] = $response; |
570 | 570 | } |
571 | 571 |
@@ -14,8 +14,8 @@ |
||
14 | 14 | $code = 0, |
15 | 15 | \Exception $previous = null |
16 | 16 | ) { |
17 | - $message = 'Could not send request to server. ' . |
|
18 | - 'CURL error ' . $code . ': ' . $message; |
|
17 | + $message = 'Could not send request to server. '. |
|
18 | + 'CURL error '.$code.': '.$message; |
|
19 | 19 | parent::__construct($message, $code, $previous); |
20 | 20 | } |
21 | 21 | } |
@@ -87,7 +87,7 @@ |
||
87 | 87 | { |
88 | 88 | return array_reduce( |
89 | 89 | array_filter($headers), |
90 | - static function ($result, $header) { |
|
90 | + static function($result, $header) { |
|
91 | 91 | if (mb_strpos($header, ':') === false) { |
92 | 92 | $result['Status'] = trim($header); |
93 | 93 |
@@ -3,12 +3,12 @@ |
||
3 | 3 | // If running this outside of this context, use the following include and |
4 | 4 | // comment out the two includes below |
5 | 5 | // require __DIR__ . '/vendor/autoload.php'; |
6 | -include(dirname(__DIR__) . '/lib/Client.php'); |
|
7 | -include(dirname(__DIR__) . '/lib/Response.php'); |
|
6 | +include(dirname(__DIR__).'/lib/Client.php'); |
|
7 | +include(dirname(__DIR__).'/lib/Response.php'); |
|
8 | 8 | // This gets the parent directory, for your current directory use getcwd() |
9 | 9 | $path_to_config = dirname(__DIR__); |
10 | 10 | $apiKey = getenv('SENDGRID_API_KEY'); |
11 | -$headers = ['Authorization: Bearer ' . $apiKey]; |
|
11 | +$headers = ['Authorization: Bearer '.$apiKey]; |
|
12 | 12 | $client = new SendGrid\Client('https://api.sendgrid.com', $headers, '/v3'); |
13 | 13 | |
14 | 14 | // GET /v3/api_keys - retrieve all API Keys that belong to the user |
@@ -8,7 +8,7 @@ |
||
8 | 8 | { |
9 | 9 | public function testFileArePresentInRepo() |
10 | 10 | { |
11 | - $rootDir = __DIR__ . '/../..'; |
|
11 | + $rootDir = __DIR__.'/../..'; |
|
12 | 12 | |
13 | 13 | $this->assertFileExists("$rootDir/.gitignore"); |
14 | 14 | $this->assertFileExists("$rootDir/.github/workflows/test-and-deploy.yml"); |
@@ -223,12 +223,12 @@ |
||
223 | 223 | $client = new Client('https://localhost:4010'); |
224 | 224 | |
225 | 225 | $testParams = [ |
226 | - 'thing' => 'stuff', |
|
227 | - 'foo' => [ |
|
226 | + 'thing' => 'stuff', |
|
227 | + 'foo' => [ |
|
228 | 228 | 'bar', |
229 | 229 | 'bat', |
230 | 230 | 'baz', |
231 | - ], |
|
231 | + ], |
|
232 | 232 | ]; |
233 | 233 | $result = $this->callMethod($client, 'buildUrl', [$testParams]); |
234 | 234 | $this->assertEquals($result, 'https://localhost:4010/?thing=stuff&foo=bar&foo=bat&foo=baz'); |
@@ -8,7 +8,7 @@ |
||
8 | 8 | { |
9 | 9 | public function testLicenseYear() |
10 | 10 | { |
11 | - $rootDir = __DIR__ . '/../..'; |
|
11 | + $rootDir = __DIR__.'/../..'; |
|
12 | 12 | |
13 | 13 | $license = explode("\n", file_get_contents("$rootDir/LICENSE")); |
14 | 14 | $copyright = trim($license[2]); |
@@ -34,7 +34,7 @@ |
||
34 | 34 | $headers['Authorization'] = $_SERVER['REDIRECT_HTTP_AUTHORIZATION']; |
35 | 35 | } elseif (isset($_SERVER['PHP_AUTH_USER'])) { |
36 | 36 | $basic_pass = isset($_SERVER['PHP_AUTH_PW']) ? $_SERVER['PHP_AUTH_PW'] : ''; |
37 | - $headers['Authorization'] = 'Basic ' . base64_encode($_SERVER['PHP_AUTH_USER'] . ':' . $basic_pass); |
|
37 | + $headers['Authorization'] = 'Basic '.base64_encode($_SERVER['PHP_AUTH_USER'].':'.$basic_pass); |
|
38 | 38 | } elseif (isset($_SERVER['PHP_AUTH_DIGEST'])) { |
39 | 39 | $headers['Authorization'] = $_SERVER['PHP_AUTH_DIGEST']; |
40 | 40 | } |