Skip to content

Commit 2829b4f

Browse files
committed
Moved to PSR-12 formatting.
1 parent 8bf4f41 commit 2829b4f

File tree

4 files changed

+24
-16
lines changed

4 files changed

+24
-16
lines changed

src/FabianBeiner/Todoist/TodoistClient.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@
1111

1212
namespace FabianBeiner\Todoist;
1313

14+
use Exception;
1415
use GuzzleHttp\Client as GuzzleClient;
1516
use GuzzleHttp\Promise\PromiseInterface;
1617
use GuzzleHttp\RequestOptions;
18+
1719
use function strlen;
1820

1921
/**
@@ -24,7 +26,10 @@ class TodoistClient extends GuzzleClient
2426
/*
2527
* Use Traits.
2628
*/
27-
use TodoistCommentsTrait, TodoistLabelsTrait, TodoistProjectsTrait, TodoistTasksTrait;
29+
use TodoistCommentsTrait;
30+
use TodoistLabelsTrait;
31+
use TodoistProjectsTrait;
32+
use TodoistTasksTrait;
2833

2934
/**
3035
* @var string The URL of the Todoist REST API.
@@ -37,7 +42,7 @@ class TodoistClient extends GuzzleClient
3742
* @param string $apiToken The API token to access the Todoist API.
3843
* @param array $config Configuration to be passed to Guzzle client.
3944
*
40-
* @throws \FabianBeiner\Todoist\TodoistException
45+
* @throws TodoistException
4146
*/
4247
public function __construct(string $apiToken, array $config = [])
4348
{
@@ -48,10 +53,10 @@ public function __construct(string $apiToken, array $config = [])
4853

4954
$defaults = [
5055
'headers' => [
51-
'Accept-Encoding' => 'gzip'
56+
'Accept-Encoding' => 'gzip',
5257
],
5358
'http_errors' => false,
54-
'timeout' => 5
59+
'timeout' => 5,
5560
];
5661

5762
$config = array_replace_recursive($defaults, $config);
@@ -68,7 +73,7 @@ public function __construct(string $apiToken, array $config = [])
6873
* @param string $uri
6974
* @param array $options
7075
*
71-
* @throws \Exception
76+
* @throws Exception
7277
* @return PromiseInterface
7378
*/
7479
public function requestAsync($method, $uri = '', array $options = []): PromiseInterface

src/FabianBeiner/Todoist/TodoistCommentsTrait.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,12 @@ public function createComment(string $type, int $typeId, string $comment)
109109
return false;
110110
}
111111

112-
$data = $this->prepareRequestData([
113-
$type . '_id' => $typeId,
114-
'content' => $comment,
115-
]);
112+
$data = $this->prepareRequestData(
113+
[
114+
$type . '_id' => $typeId,
115+
'content' => $comment,
116+
]
117+
);
116118
/** @var object $result Result of the POST request. */
117119
$result = $this->post('comments', $data);
118120

tests/FabianBeiner/Todoist/TodoistClientTest.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace FabianBeiner\Todoist\Tests;
44

55
use FabianBeiner\Todoist\TodoistClient;
6+
use FabianBeiner\Todoist\TodoistException;
67
use GuzzleHttp\Psr7\Uri;
78
use PHPUnit\Framework\TestCase;
89

@@ -28,7 +29,7 @@ public function setUp()
2829
*
2930
* @param array $options
3031
*
31-
* @throws \FabianBeiner\Todoist\TodoistException
32+
* @throws TodoistException
3233
*/
3334
public function testConfiguration(array $options = [])
3435
{
@@ -46,7 +47,7 @@ public function testConfiguration(array $options = [])
4647
}
4748

4849
/**
49-
* @throws \FabianBeiner\Todoist\TodoistException
50+
* @throws TodoistException
5051
*/
5152
public function testGetAllProjects()
5253
{
@@ -56,7 +57,7 @@ public function testGetAllProjects()
5657
}
5758

5859
/**
59-
* @throws \FabianBeiner\Todoist\TodoistException
60+
* @throws TodoistException
6061
* @return int ID of the created project.
6162
*/
6263
public function testCreateProject()
@@ -74,7 +75,7 @@ public function testCreateProject()
7475
*
7576
* @param $id
7677
*
77-
* @throws \FabianBeiner\Todoist\TodoistException
78+
* @throws TodoistException
7879
*/
7980
public function testGetProject($id)
8081
{
@@ -88,7 +89,7 @@ public function testGetProject($id)
8889
*
8990
* @param $id
9091
*
91-
* @throws \FabianBeiner\Todoist\TodoistException
92+
* @throws TodoistException
9293
*/
9394
public function testUpdateProject($id)
9495
{
@@ -102,7 +103,7 @@ public function testUpdateProject($id)
102103
*
103104
* @param $id
104105
*
105-
* @throws \FabianBeiner\Todoist\TodoistException
106+
* @throws TodoistException
106107
*/
107108
public function testDeleteProject($id)
108109
{

tests/FabianBeiner/Todoist/TodoistExceptionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function testInstantiation()
1919
}
2020

2121
/**
22-
* @expectedException \FabianBeiner\Todoist\TodoistException
22+
* @expectedException TodoistException
2323
* @expectedExceptionMessage Some message.
2424
*/
2525
public function testTodoistExceptionThrowable()

0 commit comments

Comments
 (0)