========================= Rule ``class_definition`` ========================= Whitespace around the keywords of a class, trait or interfaces definition should be one space. Configuration ------------- ``multi_line_extends_each_single_line`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Whether definitions should be multiline. .. note:: The previous name of this option was ``multiLineExtendsEachSingleLine`` but it is now deprecated and will be removed on next major version. Allowed types: ``bool`` Default value: ``false`` ``single_item_single_line`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Whether definitions should be single line when including a single item. .. note:: The previous name of this option was ``singleItemSingleLine`` but it is now deprecated and will be removed on next major version. Allowed types: ``bool`` Default value: ``false`` ``single_line`` ~~~~~~~~~~~~~~~ Whether definitions should be single line. .. note:: The previous name of this option was ``singleLine`` but it is now deprecated and will be removed on next major version. Allowed types: ``bool`` Default value: ``false`` Examples -------- Example #1 ~~~~~~~~~~ *Default* configuration. .. code-block:: diff --- Original +++ New @@ -1,13 +1,13 @@ true]``. .. code-block:: diff --- Original +++ New @@ -1,6 +1,4 @@ true]``. .. code-block:: diff --- Original +++ New @@ -1,6 +1,4 @@ true]``. .. code-block:: diff --- Original +++ New @@ -1,5 +1,7 @@ true]`` @PhpCsFixer Using the ``@PhpCsFixer`` rule set will enable the ``class_definition`` rule with the config below: ``['single_line' => true]``