Skip to content

Commit e2ace29

Browse files
committed
Fix cs
1 parent 779dbba commit e2ace29

27 files changed

+160
-124
lines changed

src/Api/IncomingRequests.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function accept($requestId)
4545
);
4646
}
4747

48-
public function reject($requestId)
48+
public function reject($requestId): void
4949
{
5050
$this->client->delete("incoming_requests/{$requestId}");
5151
}

src/Api/Rooms.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717

1818
class Rooms
1919
{
20-
const ACTION_TYPE_LEAVE = 'leave';
21-
const ACTION_TYPE_DELETE = 'delete';
20+
public const ACTION_TYPE_LEAVE = 'leave';
21+
public const ACTION_TYPE_DELETE = 'delete';
2222

2323
/**
2424
* @var ClientInterface
@@ -93,7 +93,7 @@ public function create(Room $room, MemberCollection $members)
9393
*
9494
* @param Room $room
9595
*/
96-
public function update(Room $room)
96+
public function update(Room $room): void
9797
{
9898
$this->client->put(
9999
"rooms/{$room->roomId}",
@@ -109,7 +109,7 @@ public function update(Room $room)
109109
*
110110
* @throws InvalidArgumentException
111111
*/
112-
public function remove(Room $room, $actionType)
112+
public function remove(Room $room, $actionType): void
113113
{
114114
if ('leave' !== $actionType && 'delete' !== $actionType) {
115115
throw new InvalidArgumentException('ActionType is only leave or delete');

src/Api/Rooms/Files.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,12 @@ public function show($accountId = null)
7474
public function detail($id, $downloadLink = false)
7575
{
7676
return $this->factory->entity(
77-
$this->client->get(
78-
"rooms/{$this->roomId}/files/{$id}",
79-
[
80-
'create_download_url' => (int) $downloadLink,
81-
]
82-
)
77+
$this->client->get(
78+
"rooms/{$this->roomId}/files/{$id}",
79+
[
80+
'create_download_url' => (int) $downloadLink,
81+
]
82+
)
8383
);
8484
}
8585
}

src/Api/Rooms/Members.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function show()
5555
/**
5656
* @param MemberCollection $members
5757
*/
58-
public function update(MemberCollection $members)
58+
public function update(MemberCollection $members): void
5959
{
6060
$options = [
6161
'members_admin_ids' => implode(',', $members->getAdminIds()),

src/Api/Rooms/Messages.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function detail($id, $force = false)
8282
/**
8383
* @param Message $message
8484
*/
85-
public function create(Message $message)
85+
public function create(Message $message): void
8686
{
8787
$result = $this->client->post(
8888
"rooms/{$this->roomId}/messages",
@@ -98,7 +98,7 @@ public function create(Message $message)
9898
* @param Message $message
9999
* @param $id
100100
*/
101-
public function update(Message $message, $id)
101+
public function update(Message $message, $id): void
102102
{
103103
$result = $this->client->put(
104104
"rooms/{$this->roomId}/messages/{$id}",
@@ -113,7 +113,7 @@ public function update(Message $message, $id)
113113
/**
114114
* @param $id
115115
*/
116-
public function delete($id)
116+
public function delete($id): void
117117
{
118118
$result = $this->client->delete(
119119
"rooms/{$this->roomId}/messages/{$id}"

src/Client/Client.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@ public function __construct(
3131
string $chatworkToken,
3232
string $apiVersion
3333
) {
34-
$httpClient->getConfig('handler')->push(Middleware::mapRequest(function (RequestInterface $request) use ($chatworkToken) {
35-
return $request->withHeader('X-ChatWorkToken', $chatworkToken);
36-
}));
34+
$httpClient->getConfig('handler')->push(Middleware::mapRequest(fn (RequestInterface $request) => $request->withHeader('X-ChatWorkToken', $chatworkToken)));
3735
$this->apiVersion = $apiVersion;
3836
$this->httpClient = $httpClient;
3937
}

tests/Api/ContactsTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<?php
2+
3+
declare(strict_types=1);
24
/**
35
* Created by PhpStorm.
46
* User: polidog
@@ -19,7 +21,7 @@ class ContactsTest extends TestCase
1921
/**
2022
* @dataProvider providerResponseData
2123
*/
22-
public function testShow($apiResult)
24+
public function testShow($apiResult): void
2325
{
2426
$client = $this->prophesize(ClientInterface::class);
2527
$client->get('contacts')

tests/Api/IncomingRequestsTest.php

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

3+
declare(strict_types=1);
34

45
namespace Polidog\Chatwork\Api;
56

6-
77
use PHPUnit\Framework\TestCase;
88
use Polidog\Chatwork\Client\ClientInterface;
99
use Polidog\Chatwork\Entity\Collection\EntityCollection;
@@ -15,7 +15,7 @@ class IncomingRequestsTest extends TestCase
1515
/**
1616
* @dataProvider providerIncomingRequests
1717
*/
18-
public function testShow($apiResults)
18+
public function testShow($apiResults): void
1919
{
2020
$client = $this->prophesize(ClientInterface::class);
2121
$factory = new IncomingRequestsFactory();
@@ -24,7 +24,7 @@ public function testShow($apiResults)
2424
->willReturn($apiResults);
2525

2626
$api = new IncomingRequests($client->reveal(), $factory);
27-
$incomingRequests =$api->show();
27+
$incomingRequests = $api->show();
2828
$this->assertInstanceOf(EntityCollection::class, $incomingRequests);
2929
foreach ($incomingRequests as $incomingRequest) {
3030
$this->assertInstanceOf(IncomingRequest::class, $incomingRequest);
@@ -35,7 +35,7 @@ public function testShow($apiResults)
3535
/**
3636
* @dataProvider providerIncomingRequestPut
3737
*/
38-
public function testAccept($apiResults)
38+
public function testAccept($apiResults): void
3939
{
4040
$requestId = 1;
4141

@@ -46,7 +46,7 @@ public function testAccept($apiResults)
4646
->willReturn($apiResults);
4747

4848
$api = new IncomingRequests($client->reveal(), $factory);
49-
$incomingRequest =$api->accept($requestId);
49+
$incomingRequest = $api->accept($requestId);
5050
$this->assertInstanceOf(IncomingRequest::class, $incomingRequest);
5151

5252
}

tests/Api/MeTest.php

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

3+
declare(strict_types=1);
4+
35
namespace Polidog\Chatwork\Api;
46

57
use PHPUnit\Framework\TestCase;
@@ -12,7 +14,7 @@ class MeTest extends TestCase
1214
/**
1315
* @dataProvider providerResponseData
1416
*/
15-
public function testShow($apiResult)
17+
public function testShow($apiResult): void
1618
{
1719
$client = $this->prophesize(ClientInterface::class);
1820
$client->get('me')

tests/Api/My/StatusTest.php

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

3+
declare(strict_types=1);
4+
35
namespace Polidog\Chatwork\Api\My;
46

57
use PHPUnit\Framework\TestCase;
@@ -11,7 +13,7 @@ class StatusTest extends TestCase
1113
/**
1214
* @dataProvider providerResponseData
1315
*/
14-
public function testShow($apiResult)
16+
public function testShow($apiResult): void
1517
{
1618
$client = $this->prophesize(ClientInterface::class);
1719
$client->get('my/status')

0 commit comments

Comments
 (0)