Skip to content

Commit

Permalink
DDST-416: Fix linting error
Browse files Browse the repository at this point in the history
  • Loading branch information
prashant-dgi authored Aug 20, 2024
1 parent e3c9492 commit 19b8958
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions dgi_image_discovery.install
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<?php

use Drupal\field\Entity\FieldStorageConfig;
use Drupal\field\Entity\FieldConfig;

/**
* @file
* Module installation hook implementations.
Expand All @@ -16,7 +19,7 @@ function dgi_image_discovery_update_8001() {
// Check if the field storage exists.
if (!\Drupal::service('entity_type.manager')->getStorage('field_storage_config')->load("$entity_type.$field_name")) {
// Create field storage.
\Drupal\field\Entity\FieldStorageConfig::create([
FieldStorageConfig::create([
'field_name' => $field_name,
'entity_type' => $entity_type,
'type' => 'image',
Expand All @@ -27,7 +30,7 @@ function dgi_image_discovery_update_8001() {
// Check if the field exists.
if (!\Drupal::service('entity_type.manager')->getStorage('field_config')->load("$entity_type.$vocabulary_name.$field_name")) {
// Create field instance.
\Drupal\field\Entity\FieldConfig::create([
FieldConfig::create([
'field_storage' => \Drupal::service('entity_type.manager')->getStorage('field_storage_config')->load("$entity_type.$field_name"),
'bundle' => $vocabulary_name,
'label' => 'Default Image',
Expand Down

0 comments on commit 19b8958

Please sign in to comment.