Read from the package's own PHP files at the commit 643b591aaf51: its namespaces, classes, interfaces and enums, their public constants, properties and methods with their PHPDoc, and the options its factories take. Nothing of it is run.
AkismetGatewayclassAkismet's REST API (https://akismet.com/developers/detailed-docs/): the key as the api_key parameter on https://rest.akismet.com/1.1/ - the <key>.rest.akismet.com form is the older one.
8 methods · 1 constant
AkismetGatewayFactoryclassAkismet: is this content spam.
5 options · 1 method
Omnishield\Akismet
AkismetGateway class
final class AkismetGateway implements ClassifierInterface AkismetGateway.php:31
Akismet's REST API (https://akismet.com/developers/detailed-docs/): the key as the api_key parameter on https://rest.akismet.com/1.1/ - the <key>.rest.akismet.com form is the older one.
- comment-check: "false" is ham, "true" spam - flagrant when the X-akismet-pro-tip header says "discard" -, "invalid" an error;
- submit-spam, submit-ham: "Thanks for making the web a better place.";
- verify-key: "valid" or "invalid".
An error is never taken for ham: a key refused is an InvalidKeyException, a request Akismet could not read a ProviderException, no answer an UnreachableException. Whether to let the content through then is the application's call.
AkismetGateway::__construct()
public function __construct(readonly HttpClientInterface $http, readonly string $apiKey, readonly ?string $site = null, readonly ?string $language = null, readonly bool $test = false, readonly string $baseUri = self::BASE_URI)AkismetGateway::getName()
public function getName(): stringAkismetGateway::getTitle()
public function getTitle(): stringAkismetGateway::capabilities()
public function capabilities(): CapabilitiesAkismetGateway::classify()
public function classify(Submission $submission): ClassificationAkismetGateway::report()
public function report(Submission $submission, bool $spam): voidAkismetGateway::verifyKey()
public function verifyKey(?string $site = null): boolWhether Akismet takes the key for the site - once, when the key is typed in, not before every call.
AkismetGateway::fields()
public function fields(Submission $submission): array- Returns
what Akismet is told of a submission
AkismetGatewayFactory class
final class AkismetGatewayFactory extends GatewayFactory AkismetGatewayFactory.php:21
Akismet: is this content spam.
options: api_key: '%env(AKISMET_API_KEY)%' # required site: https://example.org # the site's home page ("blog"), when a submission does not carry one language: ~ # the site's language ("blog_lang"), when a submission does not carry one: fr, fr_FR test: false # true: is_test - Akismet answers, and learns nothing base_uri: https://rest.akismet.com/1.1/
Options
| Option | Default |
|---|
AkismetGatewayFactory::__construct()
public function __construct(readonly ?HttpClientInterface $http = null)