wikimedia/wrappedstring
Automatically compact sequentially-outputted strings that share a common prefix / suffix pair.
v2.2.0
2016-07-21 00:41 UTC
Requires
- php: >=5.5.9
Requires (Dev)
- jakub-onderka/php-parallel-lint: ^0.9.0.0
- phpunit/phpunit: ^4.7.7.0
- mediawiki/mediawiki-codesniffer: 0.4.0
README
WrappedString is a small PHP library for compacting redundant string-wrapping code in text output. The most common use-case is to eliminate redundant runs of HTML open/close tags and JavaScript boilerplate.
Here is how you use it:
use WrappedString\WrappedString; $buffer = array( new WrappedString( '[foo]', '[', ']' ), new WrappedString( '[bar]', '[', ']' ), ); $output = WrappedString::join( "\n", $buffer ); // Result: '[foobar]'
License
The project is licensed under the MIT license.