diff --git a/app/Services/PluginManager.php b/app/Services/PluginManager.php index 9e6140e1..0a29fa05 100644 --- a/app/Services/PluginManager.php +++ b/app/Services/PluginManager.php @@ -223,7 +223,9 @@ class PluginManager { $providers = Arr::get($plugin->getManifest(), 'enchants.providers', []); array_walk($providers, function ($provider) use ($plugin) { - $class = Str::start(Str::finish($provider, 'ServiceProvider'), $plugin->namespace.'\\'); + $class = (string) Str::of($provider) + ->finish('ServiceProvider') + ->start($plugin->namespace.'\\'); if (class_exists($class)) { $this->app->register($class); } diff --git a/tests/HttpTest/ControllersTest/SkinlibControllerTest.php b/tests/HttpTest/ControllersTest/SkinlibControllerTest.php index 6ec8cc87..e0cd8b5e 100644 --- a/tests/HttpTest/ControllersTest/SkinlibControllerTest.php +++ b/tests/HttpTest/ControllersTest/SkinlibControllerTest.php @@ -109,8 +109,7 @@ class SkinlibControllerTest extends TestCase $keyword = Str::limit($skins->random()->name, 1, ''); $keyworded = $skins ->filter(function ($texture) use ($keyword) { - return Str::contains($texture->name, $keyword) || - Str::contains($texture->name, strtolower($keyword)); + return Str::contains($texture->name, [$keyword, strtolower($keyword)]); }); $items = $this->getJson('/skinlib/data?keyword='.$keyword) ->assertJson(['data' => [ @@ -124,8 +123,7 @@ class SkinlibControllerTest extends TestCase $keyword = Str::limit($skins->random()->name, 1, ''); $filtered = $skins ->filter(function ($texture) use ($keyword) { - return Str::contains($texture->name, $keyword) || - Str::contains($texture->name, strtolower($keyword)); + return Str::contains($texture->name, [$keyword, strtolower($keyword)]); }) ->sortByDesc('size') ->map(function ($skin) {