PHP Akismet API
This is a simple PHP library for accessing the Akismet API without any framework dependencies. Spam checking does require a PSR-7 ServerRequest but one can easily be faked using GuzzleHttp.
This is installable and autoloadable via Composer as jimwins/akismet-api. If you aren't familiar with the Composer Dependency Manager for PHP, you should read this first.
$ composer require jimwins/akismet-api --prefer-dist
<?php
$api = new \Akismet\API("{Your Akismet API Key}", "{{ your site/blog URL }}");
if (!$api->verifyKey()) {
die("That API key could not be verified.");
}
$api->commentCheck($values, $request);
$api->submitSpam($values);
$api->submitHam($values);
$api->keySites();
$api->usageLimit();
$ vendor/bin/phpunit