Skip to content
Snippets Groups Projects

Issue #3331003: Drupal Coding Standards Issues | phpcs

Open Charchil Khandelwal requested to merge issue/gtm-3331003:8.x-1.x into 8.x-1.x
2 files
+ 35
2
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 34
1
@@ -2,14 +2,47 @@
namespace Drupal\gtm\Form;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Form\ConfigFormBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Language\LanguageManagerInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Implements the form controller.
*/
class SettingsForm extends ConfigFormBase {
/**
* The language manager.
*
* @var \Drupal\Core\Language\LanguageManagerInterface
*/
protected $languageManager;
/**
* Constructs a SettingsForm object.
*
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
* The factory for configuration objects.
* @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
* The language manager.
*/
public function __construct(ConfigFactoryInterface $config_factory, LanguageManagerInterface $language_manager) {
parent::__construct($config_factory);
$this->languageManager = $language_manager;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container) {
return new static(
$container->get('config.factory'),
$container->get('language_manager'),
);
}
/**
* {@inheritdoc}
*/
@@ -70,7 +103,7 @@ class SettingsForm extends ConfigFormBase {
'#description' => $this->t(
"You can add site to
<a target='_blank' href='https://tagmanager.google.com/?hl=@lang'>Google Tag Manager</a>",
['@lang' => \Drupal::languageManager()->getCurrentLanguage()->getId()]
['@lang' => $this->languageManager->getCurrentLanguage()->getId()]
),
];
return parent::buildForm($form, $form_state);
Loading