Commit f059c29f authored by b_sharpe's avatar b_sharpe Committed by Kingdutch

Issue #2975851 by b_sharpe, Kingdutch: Use StringTranslationTrait for SeoManager

parent 6c13e6c6
......@@ -3,11 +3,11 @@
namespace Drupal\yoast_seo;
use Drupal\Core\Entity\EntityFieldManagerInterface;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\EntityTypeBundleInfoInterface;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Entity\FieldableEntityInterface;
use Symfony\Component\Yaml\Yaml;
use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\Core\StringTranslation\TranslationInterface;
/**
* Class SeoManager.
......@@ -16,6 +16,8 @@ use Symfony\Component\Yaml\Yaml;
*/
class SeoManager {
use StringTranslationTrait;
/**
* Entity Type Manager service.
*
......@@ -47,10 +49,11 @@ class SeoManager {
* @param \Drupal\Core\Entity\EntityFieldManagerInterface $entityFieldManager
* Entity Field Manager service.
*/
public function __construct(EntityTypeManagerInterface $entityTypeManager, EntityTypeBundleInfoInterface $entityTypeBundleInfo, EntityFieldManagerInterface $entityFieldManager) {
public function __construct(EntityTypeManagerInterface $entityTypeManager, EntityTypeBundleInfoInterface $entityTypeBundleInfo, EntityFieldManagerInterface $entityFieldManager, TranslationInterface $stringTranslation) {
$this->entityTypeBundleInfo = $entityTypeBundleInfo;
$this->entityTypeManager = $entityTypeManager;
$this->entityFieldManager = $entityFieldManager;
$this->stringTranslation = $stringTranslation;
}
/**
......
services:
yoast_seo.manager:
class: Drupal\yoast_seo\SeoManager
arguments: ['@entity_type.manager', '@entity_type.bundle.info', '@entity_field.manager']
arguments: ['@entity_type.manager', '@entity_type.bundle.info', '@entity_field.manager', '@string_translation']
yoast_seo.entity_analyser:
class: Drupal\yoast_seo\EntityAnalyser
arguments: ['@entity_type.manager', '@renderer', '@metatag.manager', '@router.no_access_checks']
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment