0.6.6
Fixes
- Calls at the very start of a file were skipped (#80, #81). Five sniffs guarded with
if (!$previous)on afindPrevious()result, and index0- the open tag - is falsy. So<?php sizeof($x);and<?php is_null($x);were silently ignored while the same call one line lower was caught. AffectedRemoveFunctionAlias,NoIsNull,DisallowFunctions(both copies) andShortCast.
Improvements
-
Duplicate reporting removed (#80). Three constructs were each flagged by two or three rules at once. In every case the rule with the widest coverage stays and the narrower ones are silenced, so nothing stops being detected - it is reported once instead of two or three times.
Construct Kept Silenced long casts SlevomatCodingStandard.PHP.TypeCastPSR12.Keywords.ShortFormTypeKeywords,PhpCollective.PHP.ShortCast.LongInvalidincrementer spacing Generic.WhiteSpace.IncrementDecrementSpacingImplicitCastSpacing.WhitespaceBeforeVariable/.WhitespaceAfterVariablesizeof()PhpCollective.PHP.RemoveFunctionAliasthe sizeofentry onGeneric.PHP.ForbiddenFunctionsCoverage went up rather than down:
(double)casts were previously reported by only one of the three cast rules, and that is the one that stayed. -
Unary minus spacing is now checked (#80).
- $ahad no coverage.PhpCollective.WhiteSpace.ImplicitCastSpacingalready owned this shape for!and@, so it gainedT_MINUS. Detection is deliberately conservative - a minus counts as unary only when the preceding token cannot end a value, so subtraction such as__LINE__ - 1is left alone.- -$ikeeps its space, since closing it would produce a decrement.
Full Changelog: 0.6.5...0.6.6