Some general text processing functions.
- TextProc should work with any PHP version >= 7.4.
Fork this repository from https://github.com/sfu-dhil/textproc and then clone it to your computer. Install the dependencies with
composer install
There's a quick sample/wrapper script in process
. It can be used for some
quick debugging and checking. Use it like so:
$ php process "I am a banana!"
I am a banana!
$
To use the processor class in a project,
- Require the composer autoloader
- Import the processor namespace
- Create the object
- Call some functions on the object
For example:
require 'vendor/autoload.php'; // optional - an autoloader may already be set up
use Dhil\TextProc\Processor;
$processor = new Processor();
echo $processor->doStuff("some string");
Bug reports and feature requests are tracked on GitHub. Pull requests are always welcome.
The project is configured to run the tests with the PHPUnit framework.
php vendor/bin/phpunit
Code coverage is also configured for this project.
php -d zend_extension=xdebug.so -d xdebug.mode=coverage \
vendor/bin/phpunit -c phpunit.coverage.xml
This will generate a code coverage report in coverage/
. To read it, open
coverage/index.html
in a browser. 100% code coverage is our goal, but we
also understand that it isn't always achievable.
The project is configured with the usual DHIL coding standards, implemented as
a php-cs-fixer
configuration. Apply the coding standards with
php vendor/bin/php-cs-fixer fix