Skip to content

Commit

Permalink
Merge pull request #10 from robertlemke/task/flow-8-compatibility
Browse files Browse the repository at this point in the history
Flow 8.x compatibility
  • Loading branch information
robertlemke authored May 31, 2022
2 parents b8d240d + d2b0ee3 commit af587e1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions Classes/Service.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
*/
class Service
{
const API_VERSION = '1.1';
private const API_VERSION = '1.1';

/**
* @Flow\Inject
Expand Down Expand Up @@ -139,11 +139,11 @@ public function isApiKeyValid(): bool
* @param string $author The author name specified
* @param string $authorEmailAddress The email address specified
* @param string $authorUri A URI specified linking to the author's homepage or similar
* @return boolean TRUE if the comment is considered spam, otherwise FALSE
* @return bool TRUE if the comment is considered spam, otherwise FALSE
* @throws Exception\ConnectionException
* @api
*/
public function isCommentSpam($permaLink, $content, $type, $author = '', $authorEmailAddress = '', $authorUri = ''): bool
public function isCommentSpam(string $permaLink, string $content, string $type, string $author = '', string $authorEmailAddress = '', string $authorUri = ''): bool
{
if ($this->settings['apiKey'] === '' || $this->settings['apiKey'] === null) {
$this->logger->debug('Could not check comment for spam because no Akismet API key was provided in the settings.', LogEnvironment::fromMethodName(__METHOD__));
Expand All @@ -170,7 +170,7 @@ public function isCommentSpam($permaLink, $content, $type, $author = '', $author

return false;
default:
throw new Exception\ConnectionException('API error: ' . $response->getContent() . ' ' . $response->getHeader('X-akismet-debug-help'), 1335192487);
throw new Exception\ConnectionException('API error: ' . $response->getBody()->getContents() . ' ' . reset($response->getHeaders()['X-akismet-debug-help']), 1335192487);
}
}

Expand Down Expand Up @@ -263,7 +263,7 @@ protected function sendRequest(string $command, array $arguments, bool $useAccou
throw new Exception\ConnectionException('Could not connect to Akismet API, virtual browser returned "' . var_export($response, true) . '"', 1335190115);
}
if ($response->getStatusCode() !== 200) {
throw new Exception\ConnectionException('The Akismet API server did not respond with a 200 status code: "' . $response->getStatus() . '"', 1335190117);
throw new Exception\ConnectionException('The Akismet API server did not respond with a 200 status code: "' . $response->getStatusCode() . '"', 1335190117);
}

return $response;
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
}
],
"require": {
"neos/flow": "^6.0 || ^7.0"
"neos/flow": "^6.3 || ^7.0 || ^8.0"
},
"autoload": {
"psr-4": {
Expand Down

0 comments on commit af587e1

Please sign in to comment.