- Issue created by @zniki.ru
During MR review (https://git.drupalcode.org/project/crop/-/merge_requests/18#note_419455) I faced with interesting case.
Is there policy for property naming when using DI?
Because it can help to prevent injecting same service multiple times.
In core service name converted to camelCase property name.
But I was not able to find any policy regarding property naming.
Example
form_validator:
class: Drupal\Core\Form\FormValidator
arguments: ['@request_stack', '@string_translation', '@csrf_token', '@logger.channel.form', '@form_error_handler']
# Drupal\Core\Form\FormValidator
public function __construct(RequestStack $request_stack, TranslationInterface $string_translation, CsrfTokenGenerator $csrf_token, LoggerInterface $logger, FormErrorHandlerInterface $form_error_handler) {
$this->requestStack = $request_stack;
$this->stringTranslation = $string_translation;
$this->csrfToken = $csrf_token;
$this->logger = $logger;
$this->formErrorHandler = $form_error_handler;
}
Active
8.3
Review/Rules