Releases: symplify/coding-standard
Release list
Released Coding Standard 13.1
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
AbstractDocBlockFixerbase class shared by the new fixers. - Removed
MalformWorkerInterfaceand theMalformWorker/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
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
RemovePropertyVariableNameDescriptionFixer: Support prefixed `@var` (…