bitandblack/sentence-construction
Creates nice sentences out of arrays
Maintainers
Package info
bitbucket.org/wirbelwild/sentence-construction
pkg:composer/bitandblack/sentence-construction
Fund package maintenance!
Requires
- php: >=8.0
Requires (Dev)
- phpstan/phpstan: ^2.0
- phpunit/phpunit: ^10.0
- rector/rector: ^2.0
- symplify/easy-coding-standard: ^12.0
Suggests
- bitandblack/german-words: A huge list of german words and their grammar rules
Provides
None
Conflicts
None
Replaces
None
MIT 1c1ca8fa2bef4597c5f486bf3d736f3ebd229f17
- Tobias Köngeter <hello.woop@bitandblack.com>
README
👁 PHP from Packagist
👁 Latest Stable Version
👁 Total Downloads
👁 License
Sentence construction
Creates nice sentences out of arrays.
Installation
This library is made for the use with Composer. Add it to your project by running $ composer require bitandblack/sentence-construction.
Usage
Create a sentence like that:
<?php
use BitAndBlack\SentenceConstruction;
$fruits = [
'Apples',
'Bananas',
'Pears'
];
$sentence = new SentenceConstruction(
glue: ', ',
glueLast: ' and ',
pieces: $fruits,
);
var_dump('I like ' . $sentence);
This will dump I like Apples, Bananas and Pears.
The SentenceConstruction class provides the method getSentence but is also stringable by itself, so you can simply echo it.
Help
If you have any questions, feel free to contact us under hello@bitandblack.com.
Further information about Bit&Black can be found under www.bitandblack.com.
