Repository navigation
Fixes
-
phpcbf no longer loops on inline parameter attributes (#48).
SlevomatCodingStandard.Attributes.AttributeAndTargetSpacingmoved the target of an attribute such as#[SensitiveParameter] array $credentialsonto its own line. That made the signature multi-line, so the trailing-comma sniffs added and removed a comma until phpcbf gave up with "FAILED TO FIX". Attributes on the same line as their target are now allowed. -
Fixes from
php-collective/code-sniffer0.6.10, which is the new floor. Three of them reach sniffs PSR2R enables:PhpCollective.Commenting.InlineDocBlockno longer rotates the words of an inline var annotation that has a description, and no longer adds a space before*/on every pass when the comment ends in.or similar.PhpCollective.WhiteSpace.ConsistentIndentkeeps the PSR12 indent of a multi-linefor (...)header.PhpCollective.Classes.Psr4no longer aborts the whole run when there is nocomposer.json.
Improvements
-
Wrapped operators go to the start of the continuation line (#48).
PhpCollective.Operators.OperatorPositionapplies the ruleUniversal.Operators.ConcatPositionalready enforces for.to&&,||,and,or,xor,??, the ternary?and:, and binary arithmetic operators:// before $valid = $hasName && $hasEmail; // after $valid = $hasName && $hasEmail;
-
Multi-catch types are written without spaces (#48), the same as union types:
} catch (ValueError|TypeError $e) {
PhpCollective.WhiteSpace.CatchTypeSeparatorSpacingreports the spaced form, andPhpCollective.Operators.OperatorSpacingreplacesPSR12.Operators.OperatorSpacing, which used to require the spaces. All other operators keep the PSR12 rule.
Note
Both improvements report code that passed before. All new errors are auto-fixable with phpcbf. Adjust any baseline, phpcs:ignore or ruleset exclusion that names PSR12.Operators.OperatorSpacing: the same checks now report as PhpCollective.Operators.OperatorSpacing.
Full Changelog: 2.9.0...2.10.0