Skip to content

Commit 9dfa24e

Browse files
committed
Ran php-cs-fixer ^3
1 parent 9b3464d commit 9dfa24e

File tree

10 files changed

+76
-13
lines changed

10 files changed

+76
-13
lines changed

examples/file-upload.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is a part of the DiscordPHP-Http project.
5+
*
6+
* Copyright (c) 2021-present David Cole <david.cole1340@gmail.com>
7+
*
8+
* This file is subject to the MIT license that is bundled
9+
* with this source code in the LICENSE file.
10+
*/
11+
312
use Discord\Http\Drivers\Guzzle;
413
use Discord\Http\Endpoint;
514
use Discord\Http\Http;
@@ -36,7 +45,7 @@
3645

3746
$multipart = new MultipartBody([
3847
$jsonPayloadField,
39-
$imageField
48+
$imageField,
4049
]);
4150

4251
$http->post(

src/Discord/Bucket.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class Bucket
8989
protected $resetTimer;
9090

9191
/**
92-
* Whether react/promise v3 is used, if false, using v2
92+
* Whether react/promise v3 is used, if false, using v2.
9393
*/
9494
protected $promiseV3 = true;
9595

@@ -223,4 +223,4 @@ public function __toString()
223223
{
224224
return 'BUCKET '.$this->name;
225225
}
226-
}
226+
}

src/Discord/Drivers/React.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ public function __construct(LoopInterface $loop, array $options = [])
5656

5757
/**
5858
* Runs the request using the React HTTP client.
59-
*
59+
*
6060
* @param Request $request The request to run.
61-
*
61+
*
6262
* @return PromiseInterface
6363
*/
6464
public function runRequest($request): PromiseInterface

src/Discord/Http.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,8 @@ class Http
136136
*/
137137
protected $waiting = 0;
138138

139-
140139
/**
141-
* Whether react/promise v3 is used, if false, using v2
140+
* Whether react/promise v3 is used, if false, using v2.
142141
*/
143142
protected $promiseV3 = true;
144143

@@ -333,7 +332,7 @@ protected function guessContent(&$content)
333332
/**
334333
* Executes a request.
335334
*
336-
* @param Request $request
335+
* @param Request $request
337336
* @param Deferred|null $deferred
338337
*
339338
* @return PromiseInterface
@@ -537,10 +536,10 @@ protected function checkInteractionQueue(): void
537536

538537
/**
539538
* Checks if the request is for an interaction endpoint.
540-
*
539+
*
541540
* @link https://discord.com/developers/docs/interactions/receiving-and-responding#endpoints
542541
*
543-
* @param Request $request
542+
* @param Request $request
544543
* @return bool
545544
*/
546545
public static function isInteractionEndpoint(Request $request): bool

tests/Discord/DriverInterfaceTest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is a part of the DiscordPHP-Http project.
5+
*
6+
* Copyright (c) 2021-present David Cole <david.cole1340@gmail.com>
7+
*
8+
* This file is subject to the MIT license that is bundled
9+
* with this source code in the LICENSE file.
10+
*/
11+
312
namespace Tests\Discord\Http;
413

514
use Discord\Http\DriverInterface;
@@ -65,6 +74,7 @@ public function testRequest(string $method, string $url, array $content = [], ar
6574
public function requestProvider(): array
6675
{
6776
$content = ['something' => 'value'];
77+
6878
return [
6979
'Plain get' => [
7080
'method' => 'GET',

tests/Discord/EndpointTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is a part of the DiscordPHP-Http project.
5+
*
6+
* Copyright (c) 2021-present David Cole <david.cole1340@gmail.com>
7+
*
8+
* This file is subject to the MIT license that is bundled
9+
* with this source code in the LICENSE file.
10+
*/
11+
312
namespace Tests\Discord\Http;
413

514
use Discord\Http\Endpoint;

tests/Discord/RequestTest.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is a part of the DiscordPHP-Http project.
5+
*
6+
* Copyright (c) 2021-present David Cole <david.cole1340@gmail.com>
7+
*
8+
* This file is subject to the MIT license that is bundled
9+
* with this source code in the LICENSE file.
10+
*/
11+
312
namespace Tests\Discord\Http;
413

514
use Discord\Http\Endpoint;
@@ -49,7 +58,7 @@ public function testGetUrl()
4958
{
5059
$request = $this->getRequest(null, '', new Endpoint('::url::'));
5160

52-
$this->assertEquals(Http::BASE_URL . '/::url::', $request->getUrl());
61+
$this->assertEquals(Http::BASE_URL.'/::url::', $request->getUrl());
5362
}
5463

5564
public function testGetContent()

tests/Drivers/GuzzleTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is a part of the DiscordPHP-Http project.
5+
*
6+
* Copyright (c) 2021-present David Cole <david.cole1340@gmail.com>
7+
*
8+
* This file is subject to the MIT license that is bundled
9+
* with this source code in the LICENSE file.
10+
*/
11+
312
namespace Tests\Discord\Http\Drivers;
413

514
use Discord\Http\DriverInterface;

tests/Drivers/ReactTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is a part of the DiscordPHP-Http project.
5+
*
6+
* Copyright (c) 2021-present David Cole <david.cole1340@gmail.com>
7+
*
8+
* This file is subject to the MIT license that is bundled
9+
* with this source code in the LICENSE file.
10+
*/
11+
312
namespace Tests\Discord\Http\Drivers;
413

514
use Discord\Http\DriverInterface;

tests/Drivers/_server.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,27 @@
11
<?php
22

3+
/*
4+
* This file is a part of the DiscordPHP-Http project.
5+
*
6+
* Copyright (c) 2021-present David Cole <david.cole1340@gmail.com>
7+
*
8+
* This file is subject to the MIT license that is bundled
9+
* with this source code in the LICENSE file.
10+
*/
11+
312
use React\Http\HttpServer;
413
use React\Http\Message\Response;
514
use React\Socket\SocketServer;
615

7-
require __DIR__ . '/../../vendor/autoload.php';
16+
require __DIR__.'/../../vendor/autoload.php';
817

918
$http = new HttpServer(function (Psr\Http\Message\ServerRequestInterface $request) {
1019
$response = [
1120
'method' => $request->getMethod(),
1221
'args' => $request->getQueryParams(),
1322
'json' => $request->getHeader('Content-Type') === ['application/json']
1423
? json_decode($request->getBody())
15-
: []
24+
: [],
1625
];
1726

1827
return Response::json($response);

0 commit comments

Comments
 (0)