PhpUnitExpectationFixer
is now used only on PHP 8.0+. See symplify#3130.
- [BC break] Change YAML config to PHP. See UPGRADE-3.0.md for step-by-step upgrade howto.
- Replace
Symplify\CodingStandard\Sniffs\Naming\[AbstractClassNameSniff, ClassNameSuffixByParentSniff, InterfaceNameSniff and TraitNameSniff]
with equivalent versions backported to this repository. - Drop PHP 7.2 support.
- Upgrade to easy-coding-standard 9.
- Add new fixers from PHP-CS-Fixer 2.17:
ArrayPushFixer
- Converts simple usages ofarray_push($x, $y);
to$x[] = $y;
.SwitchContinueToBreakFixer
- Switch case must not be ended withcontinue
but withbreak
.LambdaNotUsedImportFixer
- Lambda must not import variables it doesn't use.NoUselessSprintfFixer
- There must be nosprintf
calls with only the first argument.SingleSpaceAfterConstructFixer
- Ensures a single space after language constructs.CleanNamespaceFixer
- Namespace must not contain spacing, comments or PHPDoc.TernaryToElvisOperatorFixer
- Use the Elvis operator?:
where possible.PhpdocOrderByValueFixer
Order phpdoc tags by value (order by default contents of 'covers', 'group' and 'throws').HeredocIndentationFixer
- Heredoc/nowdoc content must be properly indented.
- Add new PHP_CodeSniffer sniffs:
GitMergeConflictSniff
- Detects merge conflict artifacts left in files.
- Add various dangerous function calls to list of forbidden functions.
- Fix an improper fix of PSR-2 checks made in 2.0.3 to really make them being used again.
- Fix PSR-2 checks to be used again (they were unintentionally not loaded since coding-standard version 2.0.0).
- Lock dependency of
symplify/coding-standard
to <7.2.20 to avoid deprecation errors.
- Increase required version of symplify/easy-coding-standard to ^7.2.3.
- Temporarily disable
ArrayDeclarationSniff.ValueNoNewline
because of bug in PHP_CodeSniffer 3.5.5.
- BC: change the way the standard is imported to your
easy-coding-standard.yaml
(change%vendor_dir%
placeholder directly to name of the vendor directory likevendor
). See example in README. - Drop PHP 7.1 support.
- Require EasyCodingStandard 7+.
VisibilityRequiredFixer
now check visibility is declared also on class constants.- Add
Symplify\ParamReturnAndVarTagMalformsFixer
- the@param
,@return
and@var
annotations should keep standard format. - Add new fixers from PHP-CS-Fixer 2.15 and 2.16:
NativeFunctionTypeDeclarationCasingFixer
- native type hints for functions should use the correct case.SingleTraitInsertPerStatementFixer
- each traituse
must be done as single statement.PhpUnitDedicateAssertInternalTypeFixer
- PHPUnit assertions likeassertIsArray()
should be used overassertInternalType()
(PHPUnit 7.5+ required).PhpUnitMockShortWillReturnFixer
- Use of eg.->will($this->returnValue(..))
must be replaced by its shorter equivalent such as->willReturn(...)
.
NoSuperfluousPhpdocTagsFixer
now also removes superfluous@inheritdoc
tags.
- Require EasyCodingStandard 5+.
- Add new fixers from PHP-CS-Fixer 2.14 and 2.13:
CombineNestedDirnameFixer
- replace multiple nested calls ofdirname
by only one call with second$level
parameter.FopenFlagOrderFixer
- order the flags infopen
calls,b
andt
must be last.FopenFlagsFixer
- the flags infopen
calls must containb
and must omitt
.ImplodeCallFixer
- functionimplode
must be called with 2 arguments in the documented order.PhpdocVarAnnotationCorrectOrderFixer
-@var
and@type
annotations must have type and name in the correct order
- Keep
@mixed
annotations preserved when explicitly declared.
- Replace deprecated
Symplify\CodingStandard\Fixer\Naming\MagicMethodsNamingFixer
withPhpCsFixer\Fixer\Casing\MagicMethodCasingFixer
. - Add new fixers:
NoSuperfluousPhpdocTagsFixer
to remove unnecessary@return
and@param
PHPDocs.PhpUnitTestCaseStaticMethodCallsFixer
to unify how assertion methods in PHPUnit tests are called.SetTypeToCastFixer
to ensure casting is used instead ofsettype()
.
- Change deprecated implementation of
Symplify\CodingStandard\Fixer\Naming\ClassNameSuffixByParentFixer
toSymplify\CodingStandard\Sniffs\Naming\ClassNameSuffixByParentSniff
- Fix
Generic.Commenting.DocComment.SpacingBeforeTags
being reported on one-line phpDoc annotations (when PHP_Codesniffer 3.3.0+ is used).
- Add
SpecifyArgSeparatorFixer
to make sure arg_separator is always defined when usinghttp_build_query()
function. - Add PHPUnit fixers:
PhpUnitMockFixer
: Ensure dedicated helper methodscreateMock()
andcreatePartialMock()
are used where possible instead of->getMock()
.PhpUnitNoExpectationAnnotationFixer
: UsesetExpectedException()
instead of@expectedException
annotation.PhpUnitSetUpTearDownVisibilityFixer
: Visibility ofsetUp()
andtearDown()
method should be kept protected as defined in PHPUnit TestCase.
- Do not check for
EventSubscriber
class suffixes viaClassNameSuffixByParentFixer
.
- Replace deprecated
ExceptionNameFixer
with more genericClassNameSuffixByParentFixer
.
- Initial version