This repository was archived by the owner on Nov 15, 2022. It is now read-only.
Update dependency squizlabs/php_codesniffer to v3.7.1 #126
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
*->3.7.1Release Notes
squizlabs/PHP_CodeSniffer
v3.7.1Compare Source
v3.7.0Compare Source
PHP 8.1 Language Feature Support
PHP_CodeSniffer has run correctly under PHP 8.1 since PHP 8 support was added, but it has not supported new 8.1 language features until this release. Version 3.7.0 adds support for the following PHP 8.1 language features:
nevertypeChangelog
T_ENUM_CASEtoken to represent the case statements inside an enumT_TYPE_INTERSECTIONtoken to represent the ampersand character inside intersection typesFile::getMethodParametersnow supports the new PHP 8.1 readonly tokenproperty_readonlyarray index is included in the return valuereadonly_tokenarray index is included in the return valueGeneric.PHP.LowerCaseKeywordPSR2.Classes.PropertyDeclarationSquiz.Commenting.BlockCommentSquiz.Commenting.DocCommentAlignmentSquiz.Commenting.VariableCommentSquiz.WhiteSpace.ScopeKeywordSpacingGeneric.PHP.UpperCaseConstantandGeneric.PHP.LowerCaseConstantnow ignore type declarationstrue/false/nullwhen used as valuesGeneric.PHP.LowerCaseTypenow supports the PHP 8.1nevertype@throwT_GOTO_LABEL${v3.6.2Compare Source
v3.6.1Compare Source
Generic.Files.ExecutableFileGeneric.Files.LowercasedFilenameGeneric.Files.LineEndingsGeneric.Files.EndFileNewlineGeneric.Files.EndFileNoNewlineGeneric.PHP.ClosingPHPTagGeneric.PHP.SyntaxGeneric.VersionControl.GitMergeConflictGeneric.WhiteSpace.DisallowSpaceIndentGeneric.WhiteSpace.DisallowTabIndentT_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARGandT_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARGare unsuedT_BITWISE_ANDfor all PHP versionsFile::getMethodParameters()no longer incorrectly returns argument attributes in the type hint array indexhas_attributesarray index is available and set toTRUEif the argument has attributes definedGeneric.NamingConventions.ConstructorNameno longer throws deprecation notices on PHP 8.1Squiz.Commenting.BlockCommentnow correctly applies rules for block comments after a short echo tagPEAR.Commenting.FunctionCommentSquiz.Commenting.InlineCommentSquiz.Commenting.BlockCommentSquiz.Commenting.VariableCommentSquiz.WhiteSpace.MemberVarSpacingv3.6.0Compare Source
PHP 8 Language Feature Support
PHP_CodeSniffer has run under PHP 8 for some time, but it has not supported all new language features until this release. Version 3.6.0 adds support for all new PHP 8 language features, including:
Changelog
T_TYPE_UNIONtoken is available to represent the pipe characterFile::getMethodParameters(),getMethodProperties(), andgetMemberProperties()will now return union typesT_PARAM_NAMEtoken is available to represent the label with the name of the function argument in itT_ATTRIBUTEtoken marks the start of an attributeT_ATTRIBUTE_ENDtoken is available to mark the end of an attributeattribute_ownerandattribute_closerindexes are available in the tokens array for all tokens inside an attributePEAR.Commenting.ClassCommentPEAR.Commenting.FileCommentPSR1.Files.SideEffectsPSR12.Files.FileHeaderSquiz.Commenting.ClassCommentSquiz.Commenting.FileCommentSquiz.WhiteSpace.FunctionSpacingT_MATCHtoken to process match expressionsT_MATCH_ARROWtoken is available to represent the arrows in match expressionsT_MATCH_DEFAULTtoken is available to represent the default keyword in match expressionsGeneric.CodeAnalysis.AssignmentInConditionGeneric.CodeAnalysis.EmptyPHPStatementGeneric.CodeAnalysis.EmptyStatementGeneric.PHP.LowerCaseKeywordPEAR.ControlStructures.ControlSignaturePSR12.ControlStructures.BooleanOperatorPlacementSquiz.Commenting.LongConditionClosingCommentSquiz.Commenting.PostStatementCommentSquiz.ControlStructures.LowercaseDeclarationSquiz.ControlStructures.ControlSignatureSquiz.Formatting.OperatorBracketSquiz.PHP.DisallowMultipleAssignmentsSquiz.Objects.ObjectInstantiationSquiz.WhiteSpace.ControlStructureSpacingT_FN_ARROWtoken has changed from "T_FN_ARROW" to "PHPCS_T_FN_ARROW" to avoid package conflictsT_FN_ARROWconstantFile::findStartOfStatement()now works correctly when passed the last token in a statementFile::getMethodParameters()now supports PHP 8.0 constructor property promotionproperty_visibilityandvisibility_tokenindex if property promotion is detectedFile::getMethodProperties()now includes areturn_type_end_tokenindex in the return value--stdin-path--stdin-pathto set the file pathGeneric.NamingConventions.AbstractClassNamePrefixto enforce that class names are prefixed with "Abstract"Generic.NamingConventions.InterfaceNameSuffixto enforce that interface names are suffixed with "Interface"Generic.NamingConventions.TraitNameSuffixto enforce that trait names are suffixed with "Trait"Generic.CodeAnalysis.UnusedFunctionParametercan now be configured to ignore variable usage for specific type hintsignoreTypeHintsarray property to a list of type hints to ignoreGeneric.Formatting.MultipleStatementAlignmentcan now align statements at the start of the assignment tokenalignAtEndsniff property tofalseto align the assignment tokenstrue, so the assigned values are alignedGeneric.PHP.LowerCaseTypenow supports checking of typed propertiesGeneric.PHP.LowerCaseTypenow supports checking of union typesPEAR.Commenting.FunctionCommentandSquiz.Commenting.FunctionCommentsniffs can now ignore private and protected methodsminimumVisibilitysniff property toprotectedto ignore private methodsminimumVisibilitysniff property topublicto ignore both private and protected methodsprivate, so all methods are checkedPEAR.Commenting.FunctionCommentandSquiz.Commenting.FunctionCommentsniffs can now ignore return tags in any method__constructand__destructwere ignoredspecialMethodssniff property__constructand__destructonlyPSR2.ControlStructures.SwitchDeclarationnow supports nested switch statements where every branch terminatesCASEonly contained aSWITCHand no direct terminating statement, a fall-through error was displayedSWITCHhas a terminating statementPSR2.Methods.FunctionCallSignature.SpaceBeforeCloseBracketerror message is now reported on the closing parenthesis tokenSquiz.Commenting.FunctionCommentis now able to ignore function comments that are only inheritdoc statementsskipIfInheritdocsniff property totrueto skip checking function comments if the content is only{@​inhertidoc}false, so these comments will continue to report errorsSquiz.Commenting.FunctionCommentnow supports the PHP 8 mixed typeSquiz.PHP.NonExecutableCodenow has improved handling of syntax errorsSquiz.WhiteSpace.ScopeKeywordSpacingnow checks spacing when using PHP 8.0 constructor property promotionis_readable()Squiz.PHP.DisallowMultipleAssignmentssniffv3.5.8Compare Source
v3.5.7Compare Source
T_NULLSAFE_OBJECT_OPERATORtoken has been made available for older versionsT_OBJECT_OPERATORhave been modified to apply the same rules for the nullsafe object operatorPSR12.ControlStructures.BooleanOperatorPlacement.FoundMixederror message is now more accurate when using the allowOnly settingPSR12.Functions.NullableTypeDeclarationnow supports the PHP8 static return typeSquiz.Formatting.OperatorBracketfalse positive when exiting with a negative numberSquiz.PHP.DisallowComparisonAssignmentfalse positive for methods called on an objectv3.5.6Compare Source
File::getMethodProperties()now detects the PHP 8.0 static return typeGeneric.NamingConventions.CamelCapsFunctionNameno longer reports__serializeand__unserializeas invalid namesPEAR.NamingConventions.ValidFunctionNameno longer reports__serializeand__unserializeas invalid namesSquiz.Scope.StaticThisUsagenow detects usage of$thisinside closures and arrow functionsConfiguration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate. View repository job log here.