Skip to content

Commit 3c3c6b3

Browse files
committed
Add support for Laravel 6.0
1 parent fc617f6 commit 3c3c6b3

File tree

11 files changed

+22
-11
lines changed

11 files changed

+22
-11
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ vendor/
22
composer.lock
33
coverage.xml
44
phpunit.xml
5+
.phpunit.result.cache

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ language: php
33
sudo: false
44

55
php:
6-
- 7.1
76
- 7.2
7+
- 7.3
88

99
before_script:
1010
- travis_retry composer self-update

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Release Notes
22

3+
## v3.0.0 (2019-09-03)
4+
5+
- Added support for Laravel 6.0.
6+
37
## v2.0.2 (2019-04-09)
48

59
- Added support for Laravel 5.8.

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
],
1313
"require": {
1414
"php": "^7.1.3",
15-
"illuminate/support": "5.5.*|5.6.*|5.7.*|5.8.*",
15+
"illuminate/support": "^6.0",
1616
"symfony/polyfill-mbstring": "^1.0",
17-
"spatie/laravel-html": "^2.19"
17+
"spatie/laravel-html": "^2.23"
1818
},
1919
"require-dev": {
20-
"phpunit/phpunit": "^6.0|^7.0",
20+
"phpunit/phpunit": "^8.0",
2121
"mockery/mockery": "^1.1"
2222
},
2323
"autoload": {

src/Cursor.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
namespace OsiemSiedem\Autolink;
66

77
use Iterator;
8+
use Illuminate\Support\Arr;
89

910
class Cursor implements Iterator
1011
{
@@ -127,7 +128,7 @@ public function getState(): array
127128
*/
128129
public function setState(array $state): void
129130
{
130-
$this->position = array_get($state, 'position', 0);
131+
$this->position = Arr::get($state, 'position', 0);
131132
}
132133

133134
/**

src/Filters/LimitLengthFilter.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace OsiemSiedem\Autolink\Filters;
66

7+
use Illuminate\Support\Str;
78
use OsiemSiedem\Autolink\Contracts\Filter;
89
use OsiemSiedem\Autolink\Contracts\Element;
910

@@ -42,7 +43,7 @@ public function filter(Element $element): Element
4243
{
4344
$title = $element->getTitle();
4445

45-
$title = str_limit($title, $this->limit, $this->end);
46+
$title = Str::limit($title, $this->limit, $this->end);
4647

4748
$element->setTitle($title);
4849

src/Parser.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace OsiemSiedem\Autolink;
66

7+
use Illuminate\Support\Arr;
78
use OsiemSiedem\Autolink\Contracts\Parser as ElementParser;
89

910
class Parser
@@ -97,7 +98,7 @@ public function parse(string $text): array
9798
continue;
9899
}
99100

100-
$parsers = array_get($this->elementParsers, $character);
101+
$parsers = Arr::get($this->elementParsers, $character);
101102

102103
if (is_null($parsers)) {
103104
continue;

src/Parsers/AbstractParser.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace OsiemSiedem\Autolink\Parsers;
66

7+
use Illuminate\Support\Arr;
78
use OsiemSiedem\Autolink\Cursor;
89
use OsiemSiedem\Autolink\Contracts\Parser;
910

@@ -139,7 +140,7 @@ protected function trimMoreDelimeters(Cursor $cursor, int $start, int $end): ?ar
139140
*/
140141
protected function getMatchingParenthesis(string $parenthesis): ?string
141142
{
142-
return array_get([
143+
return Arr::get([
143144
'"' => '"',
144145
"'" => "'",
145146
')' => '(',

src/Parsers/UrlParser.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace OsiemSiedem\Autolink\Parsers;
66

7+
use Illuminate\Support\Str;
78
use OsiemSiedem\Autolink\Cursor;
89
use OsiemSiedem\Autolink\Contracts\Element;
910
use OsiemSiedem\Autolink\Elements\UrlElement;
@@ -92,6 +93,6 @@ protected function validateProtocol(Cursor $cursor, int $start): bool
9293
{
9394
$text = strtolower($cursor->getText($start, 8));
9495

95-
return starts_with($text, $this->protocols);
96+
return Str::startsWith($text, $this->protocols);
9697
}
9798
}

tests/AutolinkTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace OsiemSiedem\Tests\Autolink;
66

7+
use Illuminate\Support\Str;
78
use OsiemSiedem\Autolink\Parser;
89
use OsiemSiedem\Autolink\Autolink;
910
use OsiemSiedem\Autolink\HtmlRenderer;
@@ -44,7 +45,7 @@ private function generateLink(string $title, string $href = null): string
4445
$href = $title;
4546
}
4647

47-
if ( ! starts_with($href, ['http', 'https', 'mailto'])) {
48+
if ( ! Str::startsWith($href, ['http', 'https', 'mailto'])) {
4849
$href = 'http://'.$href;
4950
}
5051

0 commit comments

Comments
 (0)