Skip to content

Commit

Permalink
Merge pull request #6 from blankqwq/analysis-RvGapO
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
blankqwq authored Aug 26, 2021
2 parents bef7356 + ec2e516 commit 37c5ab5
Show file tree
Hide file tree
Showing 57 changed files with 435 additions and 100 deletions.
12 changes: 10 additions & 2 deletions src/Contract/ApiContract.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/*
* This file is part of the blankqwq/mirai-sdk.
*
* (c) blankqwq <[email protected]>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/

namespace Blankqwq\Mirai\Contract;

use Blankqwq\Mirai\Contract\Api\FileApiContract;
Expand All @@ -9,5 +18,4 @@

interface ApiContract extends GroupApiContract, ManageApiContract, FileApiContract, MessageApiContract
{

}
}
11 changes: 10 additions & 1 deletion src/Contract/MessageTypeContract.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
<?php

/*
* This file is part of the blankqwq/mirai-sdk.
*
* (c) blankqwq <[email protected]>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/

namespace Blankqwq\Mirai\Contract;

interface MessageTypeContract
{
public function getData();
}
}
1 change: 0 additions & 1 deletion src/Contract/MiraiApiContract.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

namespace Blankqwq\Mirai\Contract;


interface MiraiApiContract extends ApiContract
{
public function __construct($qq, $host, $verify = '', $tty = 7200);
Expand Down
14 changes: 5 additions & 9 deletions src/Drivers/Http/Http.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function getSessionKey($clear = false)
// 表示关闭了session
return null;
}
$key = self::SESSION_KEY_PREFIX . '' . $this->qq;
$key = self::SESSION_KEY_PREFIX.''.$this->qq;
if (!$clear) {
$data = Cache::get($key);
if ($data) {
Expand Down Expand Up @@ -100,7 +100,6 @@ public function getSessionKey($clear = false)
/**
* @param $verify
*
* @return array
* @throws GuzzleException
* @throws MiraiException
* @throws MiraiHttpException
Expand All @@ -118,7 +117,6 @@ public function verify($verify): array
* @param $qq
* @param $sessionKey
*
* @return array
* @throws GuzzleException
* @throws MiraiException
* @throws MiraiHttpException
Expand Down Expand Up @@ -174,8 +172,7 @@ public function about(): array

/**
* @param $api
* @param array $param
* @return array
*
* @throws GuzzleException
* @throws MiraiException
* @throws MiraiHttpException
Expand All @@ -187,8 +184,7 @@ private function query($api, array $param = []): array

/**
* @param $api
* @param array $param
* @return array
*
* @throws GuzzleException
* @throws MiraiException
* @throws MiraiHttpException
Expand Down Expand Up @@ -220,8 +216,8 @@ private function request($method, $api, $param)
} else {
$body = ['json' => $param];
}
$result = $this->client->request($method, $this->host . $api, $body);
\Log::info('request_data', [$this->host . $api, $method, $param, $result]);
$result = $this->client->request($method, $this->host.$api, $body);
\Log::info('request_data', [$this->host.$api, $method, $param, $result]);
$res = json_decode($result->getBody()->getContents(), true);
if (MiraiErrorCode::SESSION_EXPIRE_ERR === $res['code']) {
$this->sessionKey = $this->getSessionKey(true);
Expand Down
3 changes: 0 additions & 3 deletions src/Drivers/Http/Traits/FileApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,11 @@

trait FileApi
{

public function upload()
{

}

public function unlink()
{

}
}
1 change: 0 additions & 1 deletion src/Drivers/Websocket/ApiEnum.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,4 @@

class ApiEnum
{

}
11 changes: 5 additions & 6 deletions src/Enums/MessageEnum.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
class MessageEnum
{
public const MESSAGE_TYPE = [
'FriendMessage','GroupMessage',
'TempMessage','StrangerMessage',
'FriendMessage', 'GroupMessage',
'TempMessage', 'StrangerMessage',
'OtherClientMessage',

'BotGroupPermissionChangeEvent',
Expand Down Expand Up @@ -45,15 +45,14 @@ class MessageEnum
'NewFriendRequestEvent',
'MemberJoinRequestEvent',
'BotInvitedJoinGroupRequestEvent',
'CommandExecutedEvent'
'CommandExecutedEvent',
];

public const EVENT_TYPE = [

];

public const ROBOT_EVENT = [
'','','BotOfflineEventForce','BotOfflineEventDropped',
'BotReloginEvent','FriendInputStatusChangedEvent','FriendNickChangedEvent'
'', '', 'BotOfflineEventForce', 'BotOfflineEventDropped',
'BotReloginEvent', 'FriendInputStatusChangedEvent', 'FriendNickChangedEvent',
];
}
12 changes: 10 additions & 2 deletions src/Event/Event.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
<?php

/*
* This file is part of the blankqwq/mirai-sdk.
*
* (c) blankqwq <[email protected]>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/

namespace Blankqwq\Mirai\Event;

class Event
{

}
}
11 changes: 10 additions & 1 deletion src/Event/EventType/BotGroupPermissionChangeEvent.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
<?php

/*
* This file is part of the blankqwq/mirai-sdk.
*
* (c) blankqwq <[email protected]>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/

namespace Blankqwq\Mirai\Event\EventType;

class BotGroupPermissionChangeEvent
{
public $origin;
public $current;
public $group;
}
}
11 changes: 10 additions & 1 deletion src/Event/EventType/BotInvitedJoinGroupRequestEvent.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/*
* This file is part of the blankqwq/mirai-sdk.
*
* (c) blankqwq <[email protected]>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/

namespace Blankqwq\Mirai\Event\EventType;

class BotInvitedJoinGroupRequestEvent
Expand All @@ -10,4 +19,4 @@ class BotInvitedJoinGroupRequestEvent
public $groupName;
public $nick;
public $message;
}
}
11 changes: 10 additions & 1 deletion src/Event/EventType/BotJoinGroupEvent.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
<?php

/*
* This file is part of the blankqwq/mirai-sdk.
*
* (c) blankqwq <[email protected]>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/

namespace Blankqwq\Mirai\Event\EventType;

class BotJoinGroupEvent
{
public $group;
}
}
11 changes: 10 additions & 1 deletion src/Event/EventType/BotLeaveEventActive.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
<?php

/*
* This file is part of the blankqwq/mirai-sdk.
*
* (c) blankqwq <[email protected]>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/

namespace Blankqwq\Mirai\Event\EventType;

class BotLeaveEventActive
{
public $group;
}
}
11 changes: 10 additions & 1 deletion src/Event/EventType/BotLeaveEventKick.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
<?php

/*
* This file is part of the blankqwq/mirai-sdk.
*
* (c) blankqwq <[email protected]>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/

namespace Blankqwq\Mirai\Event\EventType;

class BotLeaveEventKick
{
public $group;
}
}
11 changes: 10 additions & 1 deletion src/Event/EventType/BotMuteEvent.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
<?php

/*
* This file is part of the blankqwq/mirai-sdk.
*
* (c) blankqwq <[email protected]>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/

namespace Blankqwq\Mirai\Event\EventType;

class BotMuteEvent
{
public $durationSeconds;
public $operator;
public $group;
}
}
13 changes: 11 additions & 2 deletions src/Event/EventType/BotOfflineEventActive.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
<?php

/*
* This file is part of the blankqwq/mirai-sdk.
*
* (c) blankqwq <[email protected]>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/

namespace Blankqwq\Mirai\Event\EventType;

class BotOfflineEventActive
class BotOfflineEventActive
{
public $qq;
}
}
13 changes: 11 additions & 2 deletions src/Event/EventType/BotOfflineEventDropped.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
<?php

/*
* This file is part of the blankqwq/mirai-sdk.
*
* (c) blankqwq <[email protected]>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/

namespace Blankqwq\Mirai\Event\EventType;

class BotOfflineEventDropped
class BotOfflineEventDropped
{
public $qq;
}
}
13 changes: 11 additions & 2 deletions src/Event/EventType/BotOfflineEventForce.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
<?php

/*
* This file is part of the blankqwq/mirai-sdk.
*
* (c) blankqwq <[email protected]>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/

namespace Blankqwq\Mirai\Event\EventType;

class BotOfflineEventForce
class BotOfflineEventForce
{
public $qq;
}
}
15 changes: 11 additions & 4 deletions src/Event/EventType/BotOnlineEvent.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
<?php

namespace Blankqwq\Mirai\Event\EventType;
/*
* This file is part of the blankqwq/mirai-sdk.
*
* (c) blankqwq <[email protected]>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/

use Blankqwq\Mirai\Event\Event;
namespace Blankqwq\Mirai\Event\EventType;

class BotOnlineEvent
class BotOnlineEvent
{
public $qq;
}
}
Loading

0 comments on commit 37c5ab5

Please sign in to comment.