├── BaseFormatter.php
├── CampaignNameFormatter.php
├── CinemaNameFormatter.php
├── CompanyNameFormatter.php
├── CountryNameFormatter.php
├── MovieTitleFormatter.php
├── PersonNameFormatter.php
└── VatNumberFormatter.php
You can install the package via composer:
# first add new private repository - you will need a GitHub token
composer config repositories.repo-name vcs https://github.com/brightfish-be/TextFormatter
# now require the private package
composer require brightfish/textformatter
When you need to access private GitHub repositories as well, go to: https://github.com/settings/tokens/new?scopes=repo&description=Composer+on+(host)+(date))
Note that such tokens have broad read/write permissions on your behalf, even if not needed by Composer. Tokens will be stored in plain text in "$HOME/.config/composer/auth.json" for future use by Composer.
// generic text formatter
use Brightfish\TextFormatter\BaseFormatter;
$formatter = new BaseFormatter;
$formatter->uppercaseWords(['cia', 'fbi', 'nsa']);
$formatter->lowercaseWords(['in', 'a', 'the']);
$formatter->removeWords(['draft', 'void', 'obsolete']);
$result = $formatter->clean("The dog in the house"); // the Dog in the House
$formatter = (new BaseFormatter)->setForceTransliterate(true);
use Brightfish\TextFormatter\CampaignNameFormatter;
$formatter = new CampaignNameFormatter();
use Brightfish\TextFormatter\CinemaNameFormatter;
$formatter = new CinemaNameFormatter();
$result = $formatter->format("pathe charleroi"); // Pathé Charleroi
use Brightfish\TextFormatter\CompanyNameFormatter;
$formatter = new CompanyNameFormatter();
use Brightfish\TextFormatter\MovieTitleFormatter;
$formatter = new MovieTitleFormatter();
use Brightfish\TextFormatter\PersonNameFormatter;
$formatter = new PersonNameFormatter();
composer test
Please see CHANGELOG for more information on what has changed recently.
The MIT License (MIT). Please see License File for more information.