---
title: "format/comments"
pagination: false
---

{/* Generated by scripts/gen-rule-docs.py. Edit mapping.toml, not this file. */}

Comments other than PHPDoc, including ignore comments. Also in [lint](/docs/rules/lint/comments) (1) and [analyse](/docs/rules/analyse/comments) (1).

**[align-multiline](/docs/rules/format/comments/align-multiline)**

Each line of multi-line DocComments must have an asterisk [PSR-5] and must be aligned with the first one.

Not in any preset. Safe fix.

**[header](/docs/rules/format/comments/header)**

Add, replace or remove header comment.

Not in any preset. Safe fix.

**[multiline-delimiters](/docs/rules/format/comments/multiline-delimiters)**

DocBlocks must start with two asterisks, multiline comments must start with a single asterisk, after the opening slash. Both must end with a single asterisk before the closing slash.

Not in any preset. Safe fix.

**[no-empty](/docs/rules/format/comments/no-empty)**

There should not be any empty comments.

Not in any preset. Safe fix.

**[no-trailing-whitespace](/docs/rules/format/comments/no-trailing-whitespace)**

There must be no trailing whitespace at the end of lines in comments and PHPDocs.

In the `format-laravel` and `format-psr12` presets. Safe fix.

**[single-line-spacing](/docs/rules/format/comments/single-line-spacing)**

Single-line comments must have proper spacing.

In the `format-laravel` preset. Safe fix.

**[single-line-style](/docs/rules/format/comments/single-line-style)**

Single-line comments and multi-line comments with only one line of actual content should use the `//` syntax.

In the `format-laravel` preset. Safe fix.
