Skip to content
This repository was archived by the owner on Jul 12, 2026. It is now read-only.

Releases: symplify/coding-standard

Released Coding Standard 13.1

Choose a tag to compare

@TomasVotruba TomasVotruba released this 10 Jun 12:32
c2fdcdf

Doc block malform rules: one rule → 10 single-task fixers

The monolithic ParamReturnAndVarTagMalformsFixer (and its internal "malform worker" system) has been split into focused, single-responsibility fixers, registered together in the new docblock set. Each one fixes exactly one kind of @param / @return / @var malform, and all of them handle the @phpstan- and @psalm- prefixed variants too.

New rules & what they change

AddMissingParamNameFixer — add a missing variable name to a @param

 /**
- * @param string
+ * @param string $name
  */
 function getPerson($name)
 {
 }

AddMissingVarNameFixer — add a missing variable name to an inline @var

-/** @var int */
+/** @var int $value */
 $value = 1000;

DoubleAsteriskInlineVarFixer (new capability) — use a double-asterisk /** doc block for an inline @var

-/* @var int $variable */
+/** @var int $variable */
 $variable = 5;

FixParamNameTypoFixer — fix a typo in the @param variable name to match the real argument

 /**
  * @param string $one
- * @param string $twoTypo
+ * @param string $two
  */
 function anotherFunction(string $one, string $two)
 {
 }

RemoveDeadParamFixer — remove a dead @param line that has only a name and no type

 /**
  * @param string $name
- * @param $age
  */
 function withDeadParam(string $name, $age)
 {
 }

RemoveParamNameReferenceFixer — remove the reference & from a @param variable name

 /**
- * @param string &$name
+ * @param string $name
  */
 function paramReference($name)
 {
 }

RemoveSuperfluousReturnNameFixer — remove a superfluous variable name from a @return

 /**
- * @return int $value
+ * @return int
  */
 function function1(): int
 {
 }

RemoveSuperfluousVarNameFixer — remove a superfluous variable name from a property @var

 /**
- * @var string $property
+ * @var string
  */
 private $property;

SingleLineInlineVarDocBlockFixer — collapse a multi-line inline @var doc block into a single line

-/**
- * @var int $value
- */
+/** @var int $value */
 $value = 1000;

SwitchedTypeAndNameFixer — reorder switched type and variable name in @param / @var

 /**
- * @param $a string
- * @param $b string|null
+ * @param string $a
+ * @param string|null $b
  */
 function test($a, string $b = null): string
 {
 }

Internals

  • Added an AbstractDocBlockFixer base class shared by the new fixers.
  • Removed MalformWorkerInterface and the MalformWorker/ implementations (DeadParamMalformWorker, InlineVarMalformWorker, ParamNameReferenceMalformWorker).
  • Each new fixer ships with its own test, fixtures, and config; the rule count in the README went from 14 → 23.

Full changelog: #86

12.4.3

Choose a tag to compare

@samsonasik samsonasik released this 30 May 11:23
12.4.3
cd26aac

What's Changed

  • [Annotation] Skip multiple @ var on variable definition on RemovePropertyVariableNameDescriptionFixer by @samsonasik in #71
  • [Commenting] Skip Nested multiline array<> on ParamReturnAndVarTagMalformsFixer by @samsonasik in #73
  • [ArrayNotation] Skip Interpolation string on ArrayListItemNewlineFixer by @samsonasik in #72

Full Changelog: 12.4.2...12.4.3

12.4.2

Choose a tag to compare

@TomasVotruba TomasVotruba released this 13 May 14:38
e5a5093
RemovePropertyVariableNameDescriptionFixer: Support prefixed `@var` (…