refactor
This commit is contained in:
parent
db49cedb06
commit
6463a33744
@ -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);
|
||||
}
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user