<?php

namespace Drupal\{{module}}\Controller;

use Drupal\Core\Controller\ControllerBase;
{% if services is defined and services is not empty %}
use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
{% include 'skeleton/module/shared/services-use-operator.php.twig' %}
{% endif %}

class {{ class_name }} extends ControllerBase {% if services is defined and services is not empty %}implements ContainerInjectionInterface {% endif %}{{"\n"}}{
{% if services is defined and services is not empty %}
{% include 'skeleton/module/shared/services-class-properties-declaration.php.twig' %}

  public function __construct({{ servicesAsParameters(services)|join(', ') }})
  {
{% include 'skeleton/module/shared/services-class-properties-initialization.php.twig' %}
  }

  public static function create(ContainerInterface $container)
  {
    return new static(
{% include 'skeleton/module/shared/services-class-properties-injection.php.twig' %}
    );
  }
{% endif %}

  /**
   * {{method_name}}
   * @return string
   */
  public function {{method_name}}({{ argumentsFromRoute(route)|join(', ') }})
  {
{% if class_name == "DefaultController" %}
    return "Hello ".$name." !";
{% else %}
    return "Implements method {{method_name}}";
{% endif %}
  }
}

{% extends "base/class.php.twig" %}

namespace Drupal\{{module}}\Controller;

use Drupal\Core\Controller\ControllerBase;
{% if services is defined and services is not empty %}
use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
{% include 'skeleton/module/shared/services-use-operator.php.twig' %}
{% endif %}

class {{ class_name }} extends ControllerBase {% if services is defined and services is not empty %}implements ContainerInjectionInterface {% endif %}{{"\n"}}{
{% if services is defined and services is not empty %}
{% include 'skeleton/module/shared/services-class-properties-declaration.php.twig' %}

  public function __construct({{ servicesAsParameters(services)|join(', ') }})
  {
{% include 'skeleton/module/shared/services-class-properties-initialization.php.twig' %}
  }

  public static function create(ContainerInterface $container)
  {
    return new static(
{% include 'skeleton/module/shared/services-class-properties-injection.php.twig' %}
    );
  }
{% endif %}

  /**
   * {{method_name}}
   * @return string
   */
  public function {{method_name}}({{ argumentsFromRoute(route)|join(', ') }})
  {
{% if class_name == "DefaultController" %}
    return "Hello ".$name." !";
{% else %}
    return "Implements method {{method_name}}";
{% endif %}
  }
}

Extend from base Twig file
Extend from base Twig file
