From 8aa63ea1f246edd4aa3144840e975fd2118eb019 Mon Sep 17 00:00:00 2001 From: Chi Date: Sat, 24 Sep 2022 19:21:16 +0500 Subject: [PATCH] Code clean-up --- src/TwigTweakExtension.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/TwigTweakExtension.php b/src/TwigTweakExtension.php index 6817c14..d007798 100644 --- a/src/TwigTweakExtension.php +++ b/src/TwigTweakExtension.php @@ -183,8 +183,8 @@ class TwigTweakExtension extends AbstractExtension { */ public static function drupalEntityForm(string $entity_type, ?string $id = NULL, string $form_mode = 'default', array $values = [], bool $check_access = TRUE): array { $entity_storage = \Drupal::entityTypeManager()->getStorage($entity_type); - $entity_repository = \Drupal::service('entity.repository'); - $entity = $id ? $entity_repository->getActive($entity_type, $id) : $entity_storage->create($values); + $entity = $id ? + \Drupal::service('entity.repository')->getActive($entity_type, $id) : $entity_storage->create($values); if ($entity) { return \Drupal::service('twig_tweak.entity_form_view_builder') ->build($entity, $form_mode, $check_access);