From 9b274b07cd89f9a7fa3fd858dc2819dd3e553f39 Mon Sep 17 00:00:00 2001 From: StyleCI Bot Date: Sat, 11 Feb 2023 02:27:08 +0000 Subject: [PATCH] Apply fixes from StyleCI --- src/Http/Actions/SendTestMessage.php | 2 -- .../WechatWorkPushConfigController.php | 8 ----- .../WechatWorkPushHandleController.php | 3 +- .../WechatWorkPushUserController.php | 4 --- .../Traits/WechatWorkPushSendMessageTrait.php | 25 +++++++-------- src/Models/WechatWorkPushConfig.php | 15 +++++---- src/Models/WechatWorkPushUser.php | 31 +++++++++---------- src/WechatWorkPush.php | 1 + src/WechatWorkPushServiceProvider.php | 1 - 9 files changed, 35 insertions(+), 55 deletions(-) diff --git a/src/Http/Actions/SendTestMessage.php b/src/Http/Actions/SendTestMessage.php index 405f593..4c20cfe 100644 --- a/src/Http/Actions/SendTestMessage.php +++ b/src/Http/Actions/SendTestMessage.php @@ -14,8 +14,6 @@ class SendTestMessage extends RowAction public $name = '发送测试消息'; /** - * @param WechatWorkPushUserModel $user - * @return \Encore\Admin\Actions\Response * @throws \EasyWeChat\Kernel\Exceptions\BadResponseException * @throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException * @throws \Symfony\Contracts\HttpClient\Exception\ClientExceptionInterface diff --git a/src/Http/Controllers/WechatWorkPushConfigController.php b/src/Http/Controllers/WechatWorkPushConfigController.php index ad0bbe4..943c9b5 100644 --- a/src/Http/Controllers/WechatWorkPushConfigController.php +++ b/src/Http/Controllers/WechatWorkPushConfigController.php @@ -12,10 +12,6 @@ class WechatWorkPushConfigController extends Controller { - /** - * @param Content $content - * @return Content - */ public function index(Content $content): Content { return $content @@ -34,10 +30,6 @@ public function index(Content $content): Content }); } - /** - * @param Request $request - * @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector - */ public function update(Request $request): \Illuminate\Routing\Redirector|\Illuminate\Http\RedirectResponse|\Illuminate\Contracts\Foundation\Application { $data = [ diff --git a/src/Http/Controllers/WechatWorkPushHandleController.php b/src/Http/Controllers/WechatWorkPushHandleController.php index faf8005..6764976 100644 --- a/src/Http/Controllers/WechatWorkPushHandleController.php +++ b/src/Http/Controllers/WechatWorkPushHandleController.php @@ -14,8 +14,7 @@ class WechatWorkPushHandleController extends Controller /** * @param $secret - * @param Request $request - * @return array + * * @throws \EasyWeChat\Kernel\Exceptions\BadResponseException * @throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException * @throws \Symfony\Contracts\HttpClient\Exception\ClientExceptionInterface diff --git a/src/Http/Controllers/WechatWorkPushUserController.php b/src/Http/Controllers/WechatWorkPushUserController.php index 5a801b0..88558ef 100644 --- a/src/Http/Controllers/WechatWorkPushUserController.php +++ b/src/Http/Controllers/WechatWorkPushUserController.php @@ -24,8 +24,6 @@ class WechatWorkPushUserController extends AdminController /** * Make a grid builder. - * - * @return Grid */ protected function grid(): Grid { @@ -100,8 +98,6 @@ protected function grid(): Grid /** * Make a form builder. - * - * @return Form */ protected function form(): Form { diff --git a/src/Http/Traits/WechatWorkPushSendMessageTrait.php b/src/Http/Traits/WechatWorkPushSendMessageTrait.php index fd78c4e..24268e9 100644 --- a/src/Http/Traits/WechatWorkPushSendMessageTrait.php +++ b/src/Http/Traits/WechatWorkPushSendMessageTrait.php @@ -14,13 +14,12 @@ trait WechatWorkPushSendMessageTrait /** * 使用自定配置发送消息. * - * @param array $config 配置 ['corp_id' => 'xxx', 'agent_id' => 'xxx', 'secret' => 'xxx']; - * @param string $name 用户 - * @param string $title 标题 - * @param string|null $content 内容 - * @param string|null $url 链接 + * @param array $config 配置 ['corp_id' => 'xxx', 'agent_id' => 'xxx', 'secret' => 'xxx']; + * @param string $name 用户 + * @param string $title 标题 + * @param string|null $content 内容 + * @param string|null $url 链接 * @param string|null $urlTitle 链接标题 - * @return array * * @throws InvalidArgumentException * @throws \EasyWeChat\Kernel\Exceptions\BadResponseException @@ -34,10 +33,10 @@ public function send(array $config, string $name, string $title, ?string $conten { $message = $title; if ($content) { - $message .= "\n\n" . $content; + $message .= "\n\n".$content; } if ($url) { - $message .= "\n\n" . '' . ($urlTitle ?: $url) . ''; + $message .= "\n\n".''.($urlTitle ?: $url).''; } $app = new Application($config); $api = $app->getClient(); @@ -47,7 +46,7 @@ public function send(array $config, string $name, string $title, ?string $conten 'agentid' => $config['agent_id'], 'text' => [ 'content' => $message, - ] + ], ]) ->toArray(); if (0 == $result['errcode'] && 'ok' == $result['errmsg']) { @@ -60,10 +59,10 @@ public function send(array $config, string $name, string $title, ?string $conten /** * 使用默认配置发送消息. * - * @param string $name 用户 - * @param string $title 标题 - * @param string|null $content 内容 - * @param string|null $url 链接 + * @param string $name 用户 + * @param string $title 标题 + * @param string|null $content 内容 + * @param string|null $url 链接 * @param string|null $urlTitle 链接标题 * * @throws InvalidArgumentException diff --git a/src/Models/WechatWorkPushConfig.php b/src/Models/WechatWorkPushConfig.php index 11653e0..7f07470 100644 --- a/src/Models/WechatWorkPushConfig.php +++ b/src/Models/WechatWorkPushConfig.php @@ -2,20 +2,19 @@ namespace Asundust\WechatWorkPush\Models; -use Eloquent; use Illuminate\Database\Eloquent\Model; -use Illuminate\Support\Carbon; /** - * Asundust\WechatWorkPush\Models\WechatWorkPushConfig + * Asundust\WechatWorkPush\Models\WechatWorkPushConfig. * - * @property int $id - * @property string|null $corp_id 企业ID - * @property string|null $agent_id 应用ID/agent_id - * @property string|null $secret 应用Secret + * @property int $id + * @property string|null $corp_id 企业ID + * @property string|null $agent_id 应用ID/agent_id + * @property string|null $secret 应用Secret * @property \Illuminate\Support\Carbon|null $created_at * @property \Illuminate\Support\Carbon|null $updated_at - * @property-read bool $is_complete + * @property bool $is_complete + * * @method static \Illuminate\Database\Eloquent\Builder|\Asundust\WechatWorkPush\Models\WechatWorkPushConfig newModelQuery() * @method static \Illuminate\Database\Eloquent\Builder|\Asundust\WechatWorkPush\Models\WechatWorkPushConfig newQuery() * @method static \Illuminate\Database\Eloquent\Builder|\Asundust\WechatWorkPush\Models\WechatWorkPushConfig query() diff --git a/src/Models/WechatWorkPushUser.php b/src/Models/WechatWorkPushUser.php index 93e6b24..7713fd1 100644 --- a/src/Models/WechatWorkPushUser.php +++ b/src/Models/WechatWorkPushUser.php @@ -2,25 +2,24 @@ namespace Asundust\WechatWorkPush\Models; -use Eloquent; use Illuminate\Database\Eloquent\Model; -use Illuminate\Support\Carbon; /** - * Asundust\WechatWorkPush\Models\WechatWorkPushUser + * Asundust\WechatWorkPush\Models\WechatWorkPushUser. * - * @property int $id - * @property string $name 用户的账户 - * @property string $sc_secret 用户的推送密钥 - * @property int $status 状态(0禁用1启用) - * @property string|null $corp_id 用户自定企业ID - * @property string|null $agent_id 用户自定应用ID/agent_id - * @property string|null $secret 用户自定应用Secret + * @property int $id + * @property string $name 用户的账户 + * @property string $sc_secret 用户的推送密钥 + * @property int $status 状态(0禁用1启用) + * @property string|null $corp_id 用户自定企业ID + * @property string|null $agent_id 用户自定应用ID/agent_id + * @property string|null $secret 用户自定应用Secret * @property \Illuminate\Support\Carbon|null $created_at * @property \Illuminate\Support\Carbon|null $updated_at - * @property-read string $api_address - * @property-read string $api_address_show - * @property-read bool $is_own_wechat_work + * @property string $api_address + * @property string $api_address_show + * @property bool $is_own_wechat_work + * * @method static \Illuminate\Database\Eloquent\Builder|\Asundust\WechatWorkPush\Models\WechatWorkPushUser newModelQuery() * @method static \Illuminate\Database\Eloquent\Builder|\Asundust\WechatWorkPush\Models\WechatWorkPushUser newQuery() * @method static \Illuminate\Database\Eloquent\Builder|\Asundust\WechatWorkPush\Models\WechatWorkPushUser query() @@ -47,8 +46,6 @@ class WechatWorkPushUser extends Model /** * Settings constructor. - * - * @param array $attributes */ public function __construct(array $attributes = []) { @@ -68,12 +65,12 @@ public function getIsOwnWechatWorkAttribute(): bool // api_address_show public function getApiAddressShowAttribute(): string { - return config('app.url') . '/push/***'; + return config('app.url').'/push/***'; } // api_address public function getApiAddressAttribute(): string { - return config('app.url') . '/push/' . $this->sc_secret . '?title=我是标题&content=我是内容(可不填)&url=我是链接(可不填)&url_title=链接标题(可不填)'; + return config('app.url').'/push/'.$this->sc_secret.'?title=我是标题&content=我是内容(可不填)&url=我是链接(可不填)&url_title=链接标题(可不填)'; } } diff --git a/src/WechatWorkPush.php b/src/WechatWorkPush.php index e2f697c..0a6252b 100644 --- a/src/WechatWorkPush.php +++ b/src/WechatWorkPush.php @@ -10,6 +10,7 @@ class WechatWorkPush extends Extension /** * {@inheritdoc} + * * @throws \Exception */ public static function import() diff --git a/src/WechatWorkPushServiceProvider.php b/src/WechatWorkPushServiceProvider.php index 7bee9e1..2562873 100644 --- a/src/WechatWorkPushServiceProvider.php +++ b/src/WechatWorkPushServiceProvider.php @@ -8,7 +8,6 @@ class WechatWorkPushServiceProvider extends ServiceProvider { /** - * @param WechatWorkPush $extension * @return void */ public function boot(WechatWorkPush $extension)