Commit d953e2e1 authored by KUNAL SAHU's avatar KUNAL SAHU Committed by Peter Droogmans
Browse files

Issue #3296028 by kunal_sahu, Rakhi Soni, attiks: Drupal Coding Standard Issue

parent f2d62cbc
Loading
Loading
Loading
Loading
+2 −4
Changes for src/Controller/GuidelineJsonController.php: 2 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -4,7 +4,6 @@ namespace Drupal\guidelines\Controller;

use Drupal\Core\Controller\ControllerBase;
use Drupal\Core\Entity\EntityTypeManager;
use Drupal\Core\Extension\ModuleHandler;
use Drupal\guidelines\Entity\Guideline;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\JsonResponse;
@@ -26,7 +25,7 @@ class GuidelineJsonController extends ControllerBase {
  /**
   * Constructs a new entity.
   *
   * @param Drupal\Core\Entity\EntityTypeManager $entity
   * @param Drupal\Core\Entity\EntityTypeManager $entity_type_manager
   *   This is pointing to the object of enitytype manager.
   */
  public function __construct(EntityTypeManager $entity_type_manager) {
@@ -47,7 +46,6 @@ class GuidelineJsonController extends ControllerBase {
   *
   * @param string $entity_type
   *   The entity type.
   *
   * @param string $bundle
   *   The entity bundle.
   *
@@ -62,7 +60,7 @@ class GuidelineJsonController extends ControllerBase {

    foreach ($guidelines as $guideline) {
      foreach ($guideline->field_field as $field) {
        [$e, $b, $f] = explode('.', $field->value);
        [, $b, $f] = explode('.', $field->value);
        if (!empty($bundle) && $bundle === $b) {
          $view_builder = $this->entityTypeManager()->getViewBuilder('guideline');
          $pre_render = $view_builder->view($guideline, 'default');