mirror of
https://gh.wpcy.net/https://github.com/aspirepress/AspireCloud.git
synced 2026-05-31 00:04:27 +08:00
22 lines
478 B
PHP
22 lines
478 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Utils;
|
|
|
|
class Config
|
|
{
|
|
/** @return string[] */
|
|
public static function stringList(string $input, string $delimiter = ','): array
|
|
{
|
|
return collect(explode($delimiter, $input))
|
|
->map(fn(string $item) => trim($item))
|
|
->filter(fn(string $item) => $item !== '')
|
|
->values()
|
|
->toArray();
|
|
}
|
|
|
|
private function __construct()
|
|
{
|
|
// not instantiable
|
|
}
|
|
}
|