Skip to content

Commit 87e69d8

Browse files
committed
Support Laravel 6
1 parent 104fa78 commit 87e69d8

File tree

5 files changed

+13
-12
lines changed

5 files changed

+13
-12
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
/vendor
2-
composer.lock
2+
.phpunit.result.cache
3+
composer.lock

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
language: php
22

33
php:
4-
- 7.1
54
- 7.2
65
- 7.3
76

composer.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@
2323
}
2424
],
2525
"require": {
26-
"php": ">=7.0",
27-
"illuminate/contracts": "~5.4",
28-
"illuminate/database": "~5.4",
29-
"illuminate/support": "~5.4",
26+
"php": "^7.2",
27+
"illuminate/contracts": "~5.4|~6.0",
28+
"illuminate/database": "~5.4|~6.0",
29+
"illuminate/support": "~5.4|~6.0",
3030
"laravel/scout": "~7.0"
3131
},
3232
"require-dev": {
33-
"phpunit/phpunit": "~6.0",
34-
"mockery/mockery": "~1.0"
33+
"phpunit/phpunit": "^8.3",
34+
"mockery/mockery": "^1.2.3"
3535
},
3636
"autoload": {
3737
"psr-4": {

src/PostgresEngine.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace ScoutEngines\Postgres;
44

55
use Laravel\Scout\Builder;
6+
use Illuminate\Support\Arr;
67
use Laravel\Scout\Engines\Engine;
78
use Illuminate\Database\Eloquent\Model;
89
use Illuminate\Database\Eloquent\Collection;
@@ -200,7 +201,7 @@ public function getTotalCount($results)
200201
return 0;
201202
}
202203

203-
return (int) array_first($results)
204+
return (int) Arr::first($results)
204205
->total_count;
205206
}
206207

@@ -497,7 +498,7 @@ protected function option(Model $model, $key, $default = null)
497498

498499
$options = $model->searchableOptions() ?: [];
499500

500-
return array_get($options, $key, $default);
501+
return Arr::get($options, $key, $default);
501502
}
502503

503504
/**
@@ -509,7 +510,7 @@ protected function option(Model $model, $key, $default = null)
509510
*/
510511
protected function config($key, $default = null)
511512
{
512-
return array_get($this->config, $key, $default);
513+
return Arr::get($this->config, $key, $default);
513514
}
514515

515516
/**

tests/TestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
abstract class TestCase extends BaseTestCase
99
{
10-
public function tearDown()
10+
public function tearDown(): void
1111
{
1212
// Prevent PHPUnit complaining about risky tests
1313
// because Mockery expectations are not counted towards assertions

0 commit comments

Comments
 (0)