Skip to content

Commit ed6bf81

Browse files
[Standards] Update code guidelines
1 parent 4f63c92 commit ed6bf81

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

contributing/code/standards.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,14 @@ Structure
190190
191191
* Exception and error messages must start with a capital letter and finish with a dot ``.``;
192192

193+
* Exception, error and deprecation messages containing a class name must
194+
use ``get_debug_type()`` instead of ``::class`` to retrieve it:
195+
196+
.. code-block:: diff
197+
198+
- throw new \Exception(sprintf('Command "%s" failed.', $command::class));
199+
+ throw new \Exception(sprintf('Command "%s" failed.', get_debug_type($command)));
200+
193201
* Do not use ``else``, ``elseif``, ``break`` after ``if`` and ``case`` conditions
194202
which return or throw something;
195203

0 commit comments

Comments
 (0)