Skip to content

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
asundust authored and StyleCIBot committed Mar 2, 2021
1 parent 224e7bd commit df16bf9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Http/Controllers/WechatWorkPushHandleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class WechatWorkPushHandleController extends Controller

/**
* @param $secret
* @return array
*
* @throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException
* @throws \EasyWeChat\Kernel\Exceptions\RuntimeException
*/
Expand Down
8 changes: 2 additions & 6 deletions src/Http/Traits/SendMessageTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,17 @@ trait SendMessageTrait
* @param string|null $url 链接
* @param string|null $urlTitle 链接标题
*
* @return array
*
* @throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException
* @throws \EasyWeChat\Kernel\Exceptions\RuntimeException
*/
public function send(array $config, string $name, string $title, ?string $content = null, ?string $url = null, ?string $urlTitle = null): array
{
$message = $title;
if ($content) {
$message .= "\n\n" . $content;
$message .= "\n\n".$content;
}
if ($url) {
$message .= "\n\n" . '<a href="' . $url . '">' . ($urlTitle ?: $url) . '</a>';
$message .= "\n\n".'<a href="'.$url.'">'.($urlTitle ?: $url).'</a>';
}
$messenger = Factory::work($config)->messenger;
$result = $messenger->ofAgent($config['agent_id'])->message($message)->toUser($name ?? '@all')->send();
Expand All @@ -49,8 +47,6 @@ public function send(array $config, string $name, string $title, ?string $conten
* @param string|null $url 链接
* @param string|null $urlTitle 链接标题
*
* @return array
*
* @throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException
* @throws \EasyWeChat\Kernel\Exceptions\RuntimeException
*/
Expand Down

0 comments on commit df16bf9

Please sign in to comment.