From 553519a6813c7919ba04a5b427c3f414cf5a3d1c Mon Sep 17 00:00:00 2001 From: Alexandre Daubois Date: Wed, 11 Dec 2024 16:44:17 +0100 Subject: [PATCH] Add `must` usage in coding standards --- contributing/code/standards.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/contributing/code/standards.rst b/contributing/code/standards.rst index 39d96d9e247..adf47792b3e 100644 --- a/contributing/code/standards.rst +++ b/contributing/code/standards.rst @@ -195,6 +195,9 @@ Structure - throw new \Exception(sprintf('Command "%s" failed.', $command::class)); + throw new \Exception(sprintf('Command "%s" failed.', get_debug_type($command))); +* User-oriented exception, error and deprecation messages must not use ``must``. Instead, + alternative phrasing should be used: ``should``, ``needs to``, ``has to``, etc. + * Do not use ``else``, ``elseif``, ``break`` after ``if`` and ``case`` conditions which return or throw something;