Skip to content

Commit b0f2d12

Browse files
committed
Fix test
1 parent b8b0881 commit b0f2d12

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

src/Autolink.php

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class Autolink
1818
*/
1919
public array $options = [
2020
'strip_scheme' => false,
21-
'text_limit' => false,
21+
'text_limit' => null,
2222
'auto_title' => false,
2323
'escape' => true,
2424
'link_no_scheme' => false
@@ -194,12 +194,12 @@ public function link(string $url, array $attribs = []): string
194194
/**
195195
* buildLink
196196
*
197-
* @param string $url
198-
* @param array $attribs
197+
* @param string|null $url
198+
* @param array $attribs
199199
*
200200
* @return string
201201
*/
202-
protected function buildLink(string $url = null, array $attribs = []): string
202+
protected function buildLink(?string $url = null, array $attribs = []): string
203203
{
204204
if (is_callable($this->linkBuilder)) {
205205
return (string) ($this->linkBuilder)($url, $attribs);
@@ -236,7 +236,7 @@ public function stripScheme(bool $value = false): static
236236

237237
public function isStripScheme(): bool
238238
{
239-
return $this->getOption('strip_scheme');
239+
return (bool) $this->getOption('strip_scheme');
240240
}
241241

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

247247
public function isAutoEscape(): bool
248248
{
249-
return $this->getOption('escape');
249+
return (bool) $this->getOption('escape');
250250
}
251251

252252
/**
253-
* textLimit
254-
*
255-
* @param int|callable $value
253+
* @param int|callable|null $value
256254
*
257255
* @return static
258256
*/
@@ -280,7 +278,7 @@ public function autoTitle(bool $value = false): static
280278

281279
public function isAutoTitle(): bool
282280
{
283-
return $this->getOption('auto_title');
281+
return (bool) $this->getOption('auto_title');
284282
}
285283

286284
/**
@@ -442,8 +440,6 @@ public function setLinkBuilder(callable $linkBuilder): static
442440
}
443441

444442
/**
445-
* shorten
446-
*
447443
* @param string $url
448444
* @param int $lastPartLimit
449445
* @param int $dots

src/LinkHelper.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
* The LinkHelper class.
99
*
1010
* @since 1.0
11+
*
12+
* @deprecated
1113
*/
1214
class LinkHelper
1315
{
@@ -35,6 +37,8 @@ class LinkHelper
3537
* @return string
3638
*
3739
* @since 1.1.1
40+
*
41+
* @deprecated Use Autolink::shortenUrl() instead.
3842
*/
3943
public static function shorten(string $url, int $lastPartLimit = 15, int $dots = 6): string
4044
{

0 commit comments

Comments
 (0)