Skip to content

Commit 991027d

Browse files
authored
Apply fixes from StyleCI (#5)
Apply fixes from StyleCI
2 parents 5af76f1 + 028d4e1 commit 991027d

File tree

7 files changed

+10
-10
lines changed

7 files changed

+10
-10
lines changed

src/HtmlRenderer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function render(string $text, array $elements, callable $callback = null)
4646
$elements[$i] = $filter->filter($elements[$i]);
4747
}
4848

49-
if ( ! is_null($callback)) {
49+
if (! is_null($callback)) {
5050
$elements[$i] = $callback($elements[$i]);
5151
}
5252

src/Parsers/AbstractUrlParser.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ abstract class AbstractUrlParser extends AbstractParser
1818
*/
1919
protected function validateDomain(Cursor $cursor, int $start, bool $allowShort = true): bool
2020
{
21-
if ( ! ctype_alnum($cursor->getCharacter($start))) {
21+
if (! ctype_alnum($cursor->getCharacter($start))) {
2222
return false;
2323
}
2424

@@ -29,7 +29,7 @@ protected function validateDomain(Cursor $cursor, int $start, bool $allowShort =
2929

3030
if ($character === '.') {
3131
$dot++;
32-
} elseif ( ! ctype_alnum($character) && $character !== '-') {
32+
} elseif (! ctype_alnum($character) && $character !== '-') {
3333
break;
3434
}
3535
}

src/Parsers/UrlParser.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function parse(Cursor $cursor): ?Element
4545
return null;
4646
}
4747

48-
if ( ! $this->validateDomain($cursor, $start + 3, $this->allowShort)) {
48+
if (! $this->validateDomain($cursor, $start + 3, $this->allowShort)) {
4949
return null;
5050
}
5151

@@ -71,7 +71,7 @@ public function parse(Cursor $cursor): ?Element
7171
break;
7272
}
7373

74-
if ( ! $this->validateProtocol($cursor, $start)) {
74+
if (! $this->validateProtocol($cursor, $start)) {
7575
return null;
7676
}
7777

src/Parsers/WwwParser.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ public function parse(Cursor $cursor): ?Element
4343
return null;
4444
}
4545

46-
if ( ! $this->validateDomain($cursor, $start, $this->allowShort)) {
46+
if (! $this->validateDomain($cursor, $start, $this->allowShort)) {
4747
return null;
4848
}
4949

5050
$boundary = $cursor->getCharacter($start - 1);
5151

52-
if ( ! is_null($boundary) && ! ctype_space($boundary) && ! ctype_punct($boundary)) {
52+
if (! is_null($boundary) && ! ctype_space($boundary) && ! ctype_punct($boundary)) {
5353
return null;
5454
}
5555

src/helpers.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use Illuminate\Support\HtmlString;
66
use OsiemSiedem\Autolink\Facades\Autolink;
77

8-
if ( ! function_exists('autolink')) {
8+
if (! function_exists('autolink')) {
99
/**
1010
* Convert URLs in the string into clickable links.
1111
*

tests/AutolinkTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ private function generateLink(string $title, string $href = null): string
4545
$href = $title;
4646
}
4747

48-
if ( ! Str::startsWith($href, ['http', 'https', 'mailto'])) {
48+
if (! Str::startsWith($href, ['http', 'https', 'mailto'])) {
4949
$href = 'http://'.$href;
5050
}
5151

tests/Elements/BaseElementTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use OsiemSiedem\Autolink\Contracts\Element;
1010
use OsiemSiedem\Autolink\Elements\BaseElement;
1111

12-
final class LimitLengthFilterTest extends TestCase
12+
final class BaseElementTest extends TestCase
1313
{
1414
public function testInstanceOf(): void
1515
{

0 commit comments

Comments
 (0)