Skip to content

Commit 08fc9cc

Browse files
committed
style: fix DrupalPractice code style violations
1 parent a0a0d44 commit 08fc9cc

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/Plugin/Field/FieldType/ViewfieldItem.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -83,17 +83,17 @@ public static function propertyDefinitions(FieldStorageDefinitionInterface $fiel
8383
public function fieldSettingsForm(array $form, FormStateInterface $form_state) {
8484
$element['force_default'] = [
8585
'#type' => 'checkbox',
86-
'#title' => t('Always use default value'),
86+
'#title' => $this->t('Always use default value'),
8787
'#default_value' => $this->getSetting('force_default'),
88-
'#description' => t('Hides this field in forms and enforces the configured default value. If this is checked, you must provide a default value.'),
88+
'#description' => $this->t('Hides this field in forms and enforces the configured default value. If this is checked, you must provide a default value.'),
8989
];
9090

9191
$element['allowed_views'] = [
9292
'#type' => 'checkboxes',
93-
'#title' => t('Allowed views'),
93+
'#title' => $this->t('Allowed views'),
9494
'#options' => Views::getViewsAsOptions(TRUE, 'enabled'),
9595
'#default_value' => $this->getSetting('allowed_views'),
96-
'#description' => t('Only selected views will be available for content authors. Leave empty to allow all.'),
96+
'#description' => $this->t('Only selected views will be available for content authors. Leave empty to allow all.'),
9797
];
9898

9999
$element['#element_validate'] = [

src/Plugin/Field/FieldWidget/ViewfieldWidget.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen
3333

3434
$element['view'] = [
3535
'#type' => 'select',
36-
'#title' => t('View display'),
36+
'#title' => $this->t('View display'),
3737
'#options' => $this->getPotentialReferences(),
3838
'#empty_value' => 0,
3939
'#access' => !$field_settings['force_default'],
@@ -42,10 +42,10 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen
4242
];
4343
$element['view_args'] = [
4444
'#type' => 'textfield',
45-
'#title' => t('Arguments'),
45+
'#title' => $this->t('Arguments'),
4646
'#default_value' => isset($items[$delta]->view_args) ? $items[$delta]->view_args : NULL,
4747
'#access' => !$field_settings['force_default'],
48-
'#description' => t('A comma separated list of arguments to pass to the selected view.'),
48+
'#description' => $this->t('A comma separated list of arguments to pass to the selected view.'),
4949
];
5050
// @todo make configurable.
5151
$element['view_args']['#access'] = FALSE;
@@ -69,7 +69,7 @@ protected function getPotentialReferences() {
6969
foreach ($views as $id => $view) {
7070
if (!empty($allowed_views) && isset($allowed_views[$id])) {
7171
$label = $view->label();
72-
foreach ($view->get('display') as $display_id => $display) {
72+
foreach ($view->get('display') as $display) {
7373
if (in_array($display['display_plugin'], $allowed_display_plugins)) {
7474
$options[$label][$id . ':' . $display['id']] = $display['display_title'];
7575
}

0 commit comments

Comments
 (0)