Skip to content

Commit

Permalink
feat: lintTo支持传入空值,例如刚/未初始化的变量
Browse files Browse the repository at this point in the history
  • Loading branch information
twinh committed Jan 27, 2019
1 parent a870c66 commit 8ef105a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Service/LinkTo.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class LinkTo extends \Miaoxing\Plugin\BaseService
'links' => [],
];

public function __invoke(array $link)
public function __invoke($link)
{
if (!$link) {
return '';
Expand Down Expand Up @@ -89,10 +89,10 @@ public function getConfig()
/**
* 根据LinkTo配置,获取对应的URL地址
*
* @param array $linkTo
* @param array|null $linkTo
* @return string
*/
public function getUrl(array $linkTo)
public function getUrl($linkTo)
{
// 1. 升级数据
$linkTo = $this->upgrade($linkTo);
Expand All @@ -115,10 +115,10 @@ public function getUrl(array $linkTo)
/**
* 根据LinkTo配置,获取完整的URL地址
*
* @param array $linkTo
* @param array|null $linkTo
* @return string
*/
public function getFullUrl(array $linkTo)
public function getFullUrl($linkTo)
{
$url = $this->getUrl($linkTo);

Expand Down

0 comments on commit 8ef105a

Please sign in to comment.