Skip to content

Commit af587e1

Browse files
authored
Merge pull request #10 from robertlemke/task/flow-8-compatibility
Flow 8.x compatibility
2 parents b8d240d + d2b0ee3 commit af587e1

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Classes/Service.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
*/
3333
class Service
3434
{
35-
const API_VERSION = '1.1';
35+
private const API_VERSION = '1.1';
3636

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

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

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

269269
return $response;

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
}
1313
],
1414
"require": {
15-
"neos/flow": "^6.0 || ^7.0"
15+
"neos/flow": "^6.3 || ^7.0 || ^8.0"
1616
},
1717
"autoload": {
1818
"psr-4": {

0 commit comments

Comments
 (0)