brightfish/bf-text-formatter 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

brightfish/bf-text-formatter

最新稳定版本:1.0.9

Composer 安装命令:

composer require brightfish/bf-text-formatter

包简介

Format text the Brightfish way

README 文档

README

Tests

├── BaseFormatter.php
├── CampaignNameFormatter.php
├── CinemaNameFormatter.php
├── CompanyNameFormatter.php
├── CountryNameFormatter.php
├── MovieTitleFormatter.php
├── PersonNameFormatter.php
└── VatNumberFormatter.php

Installation

You can install the package via composer:

composer require brightfish/bf-text-formatter

Usage

BaseFormatter

// 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);

CampaignNameFormatter

use Brightfish\TextFormatter\CampaignNameFormatter;

$formatter = new CampaignNameFormatter();

CinemaNameFormatter

use Brightfish\TextFormatter\CinemaNameFormatter;

$formatter = new CinemaNameFormatter();
$result = $formatter->format("pathe charleroi");    // Pathé Charleroi

CompanyNameFormatter

use Brightfish\TextFormatter\CompanyNameFormatter;

$formatter = new CompanyNameFormatter();

MovieTitleFormatter

use Brightfish\TextFormatter\MovieTitleFormatter;

$formatter = new MovieTitleFormatter();

PersonNameFormatter

use Brightfish\TextFormatter\PersonNameFormatter;

$formatter = new PersonNameFormatter();

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 48
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-05-14