2022-11-27 15:29:29 +00:00
|
|
|
<?php
|
|
|
|
|
2023-08-20 15:24:56 +00:00
|
|
|
namespace App\Values;
|
2022-11-27 15:29:29 +00:00
|
|
|
|
|
|
|
use Illuminate\Support\Collection;
|
|
|
|
|
|
|
|
final class SmartPlaylistRuleGroupCollection extends Collection
|
|
|
|
{
|
|
|
|
public static function create(array $array): self
|
|
|
|
{
|
2024-01-12 14:41:02 +00:00
|
|
|
return new self(
|
|
|
|
collect($array)->transform(static function (array|SmartPlaylistRuleGroup $group): SmartPlaylistRuleGroup {
|
|
|
|
return $group instanceof SmartPlaylistRuleGroup ? $group : SmartPlaylistRuleGroup::make($group);
|
|
|
|
})
|
|
|
|
);
|
2022-11-27 15:29:29 +00:00
|
|
|
}
|
|
|
|
}
|