awareness-1.0.0-alpha5/templates/generator/awareness-trait.twig
templates/generator/awareness-trait.twig
<?php
declare(strict_types = 1);
namespace {{ namespace }};
{% if use %}
use {{ interface }};
{% endif %}
/**
* Trait for classes that utilize the {{ service_id}} service.
*/
trait {{ class }} {
/**
* Get the {{ service_id }} service.
*
* @return {{ interface }}
* The {{ service_id }} service.
*/
protected function {{ method }}(): {{ interface_short }} {
return \Drupal::service('{{ service_id }}');
}
}
