lllist / lllist-php
Humanized list and shit, cuz' we are human afterall
Installs: 4 312
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/lllist/lllist-php
Requires
- php: >=7.1
Requires (Dev)
- phpunit/phpunit: 5.7.*
- symfony/var-dumper: ^3.2
This package is auto-updated.
Last update: 2025-10-29 02:09:15 UTC
README
Hate build conditional lists, phrases, texts? Me too. This library is made to avoid code boilerplate when building
lists, and also avoid things like: Josecleiton likes: apple, bananas, grapes
or Josecleiton likes: apple, grapes and also do null, you could simply:
lllist(', ', ' and ') ->items(['apple', 'bananas', 'grapes'])
Which will output apple, bananas and grapes
or
lllist(', ', ' and ') ->items(['apple', 'bananas', 'grapes']) ->sep(' and also ') ->append(null)
Which will output apple, bananas and grapes too, because lllist ignores empty values and also trim separators.
If you give lllist an empty list it will return null, because it's the right thing to do™.
Example:
lllist(', ', ' and ') ->items([]) ->sep(' and also ') ->append(null)
Will output null 👍.
Documentation will be released.
Made with undefined by Wesley Schleumer