diff --git a/Classes/Finishers/SpamDetectionFinisher.php b/Classes/Finishers/SpamDetectionFinisher.php index de0a019..5b0a1dc 100644 --- a/Classes/Finishers/SpamDetectionFinisher.php +++ b/Classes/Finishers/SpamDetectionFinisher.php @@ -14,8 +14,9 @@ */ use Neos\Flow\Annotations as Flow; -use Neos\Flow\Log\SystemLoggerInterface; +use Neos\Flow\Log\Utility\LogEnvironment; use Neos\Form\Core\Model\AbstractFinisher; +use Psr\Log\LoggerInterface; class SpamDetectionFinisher extends AbstractFinisher { @@ -28,7 +29,7 @@ class SpamDetectionFinisher extends AbstractFinisher /** * @Flow\Inject - * @var SystemLoggerInterface + * @var LoggerInterface */ protected $logger; @@ -54,14 +55,14 @@ protected function executeInternal() if ($isSpam) { $formRuntime->getFormState()->setFormValue('spamDetected', $isSpam); - $this->logger->log(sprintf('The submitted form was detected as spam, as the honeypot form field %s was filled.', implode(', ', $filledOutHoneypotFields)), LOG_INFO); + $this->logger->info(sprintf('The submitted form was detected as spam, as the honeypot form field %s was filled.', implode(', ', $filledOutHoneypotFields)), LogEnvironment::fromMethodName(__METHOD__)); $formRuntime->getFormState()->setFormValue('spamMarker', '[SPAM]'); $formRuntime->getFormState()->setFormValue('spamFilledOutHoneypotFields', implode(', ', $filledOutHoneypotFields)); if ($this->cancelSubsequentFinishersOnSpamDetection) { $this->finisherContext->cancel(); - $this->logger->log('Subsequent finishers are cancelled due to spam detection.', LOG_INFO); + $this->logger->info('Subsequent finishers are cancelled due to spam detection.', LogEnvironment::fromMethodName(__METHOD__)); } } } diff --git a/composer.json b/composer.json index 5e7c5e5..7d0234d 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ ], "license": "MIT", "require": { - "neos/neos": ">3.0", + "neos/neos": "^4.1", "neos/form-builder": "*", "neos/form-fusionrenderer": "*" },