From bb61fadd54640c30e5bb313890a30de80aa9a8d4 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Fri, 7 Apr 2023 15:02:30 +0200 Subject: [PATCH] Attributes that relate to controller arguments should start with `Map` --- contributing/code/standards.rst | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/contributing/code/standards.rst b/contributing/code/standards.rst index 7313760543e..967edb0115e 100644 --- a/contributing/code/standards.rst +++ b/contributing/code/standards.rst @@ -230,8 +230,11 @@ Naming Conventions * Suffix exceptions with ``Exception``; -* Prefix PHP attributes with ``As`` where applicable (e.g. ``#[AsCommand]`` - instead of ``#[Command]``, but ``#[When]`` is kept as-is); +* Prefix PHP attributes that relate to service configuration with ``As`` + (e.g. ``#[AsCommand]``, ``#[AsEventListener]``, etc.); + +* Prefix PHP attributes that relate to controller arguments with ``Map`` + (e.g. ``#[MapEntity]``, ``#[MapCurrentUser]``, etc.); * Use UpperCamelCase for naming PHP files (e.g. ``EnvVarProcessor.php``) and snake case for naming Twig templates and web assets (``section_layout.html.twig``,