PHP library for the Respectify API. Respectify aims to improve internet discussions: encourage healthy, understanding discussion in comments and replies.
This contains the Respectify client, which is currently available only as an asychronous API using ReactPHP.
Check out src/RespectifyClientAsync.php. For info on the REST API that it wraps, have a look here.
To be able to make changes:
$ brew install php
$ brew install composerIf you want to run unit tests:
$ composer require --dev phpunit/phpunit mockery/mockery vlucas/phpdotenvand then to run tests:
$ vendor/bin/phpunit --bootstrap vendor/autoload.php testsTests are run against mocks, but there is value in running against the real API. Do do this create a tests/.venv file, with content:
USE_REAL_API=true
RESPECTIFY_EMAIL=you@example.com
RESPECTIFY_API_KEY=your-api-key-here
REAL_ARTICLE_ID=an-existing-article-id-hereusing real Respectify credentials.
Docs are generated in Markdown format for Docusaurus via the phpdocumentor-markdown-customised phpdoc theme. It is MIT-licensed. Please see the readme in that folder for more information.
You'll need twig and php-documentor installed (install the dev dependencies.)
If you have a phpdoc command available (eg, set up as a Docker container):
$ alias phpdoc="docker run --rm -v \"$(pwd)\":/data phpdoc/phpdoc:3"then you can general doc like so:
# Run phpDocumentor with --template argument pointed to markdown template
$ phpdoc --directory=src --target=docs --template="phpdocumentor-markdown-customised/themes/markdown" --title="Respectify PHP Library" -c phpdoc.xml