From b64f3bc3bb4f50e3d35ccb262b9be9d7a9016a6a Mon Sep 17 00:00:00 2001 From: Vladimir Morozov Date: Fri, 6 Sep 2019 09:26:52 +0300 Subject: [PATCH] added laravel ^6.0 support --- .gitignore | 2 ++ src/Providers/MySQLScoutServiceProvider.php | 5 +++-- src/helpers.php | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 9f11b75..ac85e9c 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ .idea/ +composer.lock +/vendor diff --git a/src/Providers/MySQLScoutServiceProvider.php b/src/Providers/MySQLScoutServiceProvider.php index c23f2ff..42e7343 100644 --- a/src/Providers/MySQLScoutServiceProvider.php +++ b/src/Providers/MySQLScoutServiceProvider.php @@ -2,6 +2,7 @@ namespace Yab\MySQLScout\Providers; +use Illuminate\Support\Str; use Yab\MySQLScout\Engines\Modes\ModeContainer; use Illuminate\Support\ServiceProvider; use Laravel\Scout\EngineManager; @@ -43,8 +44,8 @@ public function register() $this->app->singleton(ModeContainer::class, function ($app) { $engineNamespace = 'Yab\\MySQLScout\\Engines\\Modes\\'; - $mode = $engineNamespace.studly_case(strtolower(config('scout.mysql.mode'))); - $fallbackMode = $engineNamespace.studly_case(strtolower(config('scout.mysql.min_fulltext_search_fallback'))); + $mode = $engineNamespace.Str::studly(strtolower(config('scout.mysql.mode'))); + $fallbackMode = $engineNamespace.Str::studly(strtolower(config('scout.mysql.min_fulltext_search_fallback'))); return new ModeContainer(new $mode(), new $fallbackMode()); }); diff --git a/src/helpers.php b/src/helpers.php index c2a166f..94104de 100644 --- a/src/helpers.php +++ b/src/helpers.php @@ -94,7 +94,7 @@ function getClassNameFromFile($filePathName) $classes[] = $class_name; } } - if (!isset($classes[0]) { + if (!isset($classes[0])) { return 'no_class_found_in_file'; } return $classes[0];