Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
asika32764 committed May 24, 2024
1 parent b8b0881 commit b0f2d12
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
20 changes: 8 additions & 12 deletions src/Autolink.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Autolink
*/
public array $options = [
'strip_scheme' => false,
'text_limit' => false,
'text_limit' => null,
'auto_title' => false,
'escape' => true,
'link_no_scheme' => false
Expand Down Expand Up @@ -194,12 +194,12 @@ public function link(string $url, array $attribs = []): string
/**
* buildLink
*
* @param string $url
* @param array $attribs
* @param string|null $url
* @param array $attribs
*
* @return string
*/
protected function buildLink(string $url = null, array $attribs = []): string
protected function buildLink(?string $url = null, array $attribs = []): string
{
if (is_callable($this->linkBuilder)) {
return (string) ($this->linkBuilder)($url, $attribs);
Expand Down Expand Up @@ -236,7 +236,7 @@ public function stripScheme(bool $value = false): static

public function isStripScheme(): bool
{
return $this->getOption('strip_scheme');
return (bool) $this->getOption('strip_scheme');
}

public function autoEscape(bool $value = true): static
Expand All @@ -246,13 +246,11 @@ public function autoEscape(bool $value = true): static

public function isAutoEscape(): bool
{
return $this->getOption('escape');
return (bool) $this->getOption('escape');
}

/**
* textLimit
*
* @param int|callable $value
* @param int|callable|null $value
*
* @return static
*/
Expand Down Expand Up @@ -280,7 +278,7 @@ public function autoTitle(bool $value = false): static

public function isAutoTitle(): bool
{
return $this->getOption('auto_title');
return (bool) $this->getOption('auto_title');
}

/**
Expand Down Expand Up @@ -442,8 +440,6 @@ public function setLinkBuilder(callable $linkBuilder): static
}

/**
* shorten
*
* @param string $url
* @param int $lastPartLimit
* @param int $dots
Expand Down
4 changes: 4 additions & 0 deletions src/LinkHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
* The LinkHelper class.
*
* @since 1.0
*
* @deprecated
*/
class LinkHelper
{
Expand Down Expand Up @@ -35,6 +37,8 @@ class LinkHelper
* @return string
*
* @since 1.1.1
*
* @deprecated Use Autolink::shortenUrl() instead.
*/
public static function shorten(string $url, int $lastPartLimit = 15, int $dots = 6): string
{
Expand Down

0 comments on commit b0f2d12

Please sign in to comment.