Linguist is a PHP library for parsing strings, it can extract and manipulate prefixed words in content ideal for working with @mentions, #topics and custom tags!
- PHP >= 5.4.0
This library is unit tested against PHP 5.4, 5.5, 5.6, 7.0 and HHVM!
This library is released under the GPLv3 license, you are welcome to use it, improve it and contribute your changes back!
The recommended way of installing this library is via. Composer; To install using Composer type the following command at the console:
composer require ballen/linguist
Alternately you can add it to your
composer.json file manually in the
require section like so:
Then install the package by running the
composer update ballen/linguist command.
A set of working examples can be found in the
Tests and coverage
This library is fully unit tested using PHPUnit.
I use TravisCI for continuous integration, which triggers tests for PHP 5.4, 5.5, 5.6, 7.0 and HHVM every time a commit is pushed.
If you wish to run the tests yourself you should run the following:
# Install the Linguist Library with the 'development' packages this then includes PHPUnit! composer install --dev # Now we run the unit tests (from the root of the project) like so: ./vendor/bin/phpunit
Code coverage can also be ran but requires XDebug installed...
./vendor/bin/phpunit --coverage-html ./report
I am happy to provide support via. my personal email address, so if you need a hand drop me an email at: firstname.lastname@example.org.