Download the PHP package manialib/formatting without Composer
On this page you can find all versions of the php package manialib/formatting. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download manialib/formatting
More information about manialib/formatting
Files in manialib/formatting
Package formatting
Short Description Manipulate styles in Maniaplanet strings.
License MIT
Homepage https://github.com/manialib/formatting
Informations about the package formatting
Manialib\Formatting
Manialib\Formatting is a PHP package for manipulating styles in Maniaplanet strings.
Learn more about Maniaplanet formatting characters on the wiki.
Beta
This is a work in progress. As long as we don't release a stable version, we might break stuff at any point. If this is a problem, feel free to open an issue and we'll try to help.
Features
- Strip styles from strings: links, colors, etc.
- Convert strings to other formats: HTML for now
Find out more in the change log.
Requirements
- PHP 8.1+
Installation
Usage
Modify styles of a string:
Note the String fluent interface which allows to chain method calls
Will output:
Convert a string to HTML:
Will output:
Everything you need for using this should be documented in Manialib/Formatting/StringInterface
.
Tests
$ php vendor/bin/phpunit
$ php vendor/bin/phpcs --standard=PSR2 src
Development guidelines
We follow best practices from the amazing PHP ecosystem. Warm kudos to Symfony, The PHP League, the PHP subreddit and many more for inspiration and challenging ideas.
- We adhere to the best-practices put forward by PHP The Right Way
- We comply to the standards of the PHP-FIG
- We distribute code via Packagist and Composer
- We manage version numbers with Semantic Versioning
- We keep a changelog
- We use
Manialib\
as our PHP vendor namespace - We use
manialib/
as our Packagist vendor namespace - We'll (try to) make documentation & tests :)