mirror of
https://github.com/koel/koel
synced 2024-12-25 20:13:06 +00:00
17 lines
483 B
PHP
17 lines
483 B
PHP
<?php
|
|
|
|
namespace App\Values;
|
|
|
|
use Illuminate\Support\Collection;
|
|
|
|
final class SmartPlaylistRuleGroupCollection extends Collection
|
|
{
|
|
public static function create(array $array): self
|
|
{
|
|
return new self(
|
|
collect($array)->transform(static function (array|SmartPlaylistRuleGroup $group): SmartPlaylistRuleGroup {
|
|
return $group instanceof SmartPlaylistRuleGroup ? $group : SmartPlaylistRuleGroup::make($group);
|
|
})
|
|
);
|
|
}
|
|
}
|