Skip to content

Files

Latest commit

 

History

History
42 lines (32 loc) · 1.93 KB

SlevomatCodingStandard.Commenting.DocCommentSpacing.md

File metadata and controls

42 lines (32 loc) · 1.93 KB

Pattern: Inconsistent doc comment spacing

Issue: -

Description

Enforces configurable number of lines before first content (description or annotation), after last content (description or annotation), between description and annotations, between two different annotation types (eg. between @param and @return).

Rule provides the following settings:

  • linesCountBeforeFirstContent: allows to configure the number of lines before first content (description or annotation).
  • linesCountBetweenDescriptionAndAnnotations: allows to configure the number of lines between description and annotations.
  • linesCountBetweenDifferentAnnotationsTypes: allows to configure the number of lines between two different annotation types.
  • linesCountBetweenAnnotationsGroups: allows to configure the number of lines between annotation groups.
  • linesCountAfterLastContent: allows to configure the number of lines after last content (description or annotation).
  • annotationsGroups: allows to configure order of annotation groups and even order of annotations in every group. Supports prefixes, eg. @ORM\.
<rule ref="SlevomatCodingStandard.Commenting.DocCommentSpacing">
	<properties>
		<property name="annotationsGroups" type="array">
			<element value="
				@ORM\,
			"/>
			<element value="
				@var,
				@param,
				@return,
			"/>
		</property>
	</properties>
</rule>

If annotationsGroups is set, linesCountBetweenDifferentAnnotationsTypes is ignored and linesCountBetweenAnnotationsGroups is applied. If annotationsGroups is not set, linesCountBetweenAnnotationsGroups is ignored and linesCountBetweenDifferentAnnotationsTypes is applied.

Annotations not in any group are placed to automatically created last group.

Further Reading