fomvasss/static-lists

Deterministic list builder for arrays/iterables (only, except, added, unique, sort).

Installs: 9

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/fomvasss/static-lists

1.0.0 2025-10-19 10:26 UTC

This package is auto-updated.

Last update: 2025-10-19 10:29:50 UTC


README

License Build Status Latest Stable Version Total Downloads

Deterministic list builder for arrays/iterables.

use Fomvasss\StaticLists\StaticListBuilder;

$records = [
    ['value' => 'new', 'label' => 'New', 'priority' => 30],
    ['value' => 'paid', 'label' => 'Paid', 'priority' => 10],
    ['value' => 'done', 'label' => 'Done', 'priority' => 40],
];

$map = StaticListBuilder::build($records, 'label', 'value', [
  'only' => ['paid','new'],
  'sort' => 'priority',
  'order'=> 'asc',
]);