Commit a4f5923d authored by Krzysztof Domański's avatar Krzysztof Domański Committed by kdo_abv
Browse files

Issue #3073450 by Krzysztof Domański, Sergiu Stici: Replace deprecated...

Issue #3073450 by Krzysztof Domański, Sergiu Stici: Replace deprecated drupal_set_message() with \Drupal::messenger()
parent 3c2ddcbd
Loading
Loading
Loading
Loading
+3 −1
Changes for src/RateBotDetector.php: 3 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@ namespace Drupal\rate;

use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Database\Connection;
use Drupal\Core\Messenger\MessengerTrait;
use Drupal\Core\StringTranslation\StringTranslationTrait;
use GuzzleHttp\Client;
use GuzzleHttp\Exception\RequestException;
@@ -14,6 +15,7 @@ use Symfony\Component\HttpFoundation\RequestStack;
 */
class RateBotDetector {
  use StringTranslationTrait;
  use MessengerTrait;

  /**
   * Client IP.
@@ -167,7 +169,7 @@ class RateBotDetector {
        }
      }
      catch (RequestException $e) {
        drupal_set_message($this->t('An error occurred contacting BotScout.'), 'warning');
        $this->messenger()->addMessage($this->t('An error occurred contacting BotScout.'), 'warning');
        watchdog_exception('rate', $e);
      }
    }