diff --git a/docs/components/sniffs/PHP50.md b/docs/components/sniffs/PHP50.md new file mode 100644 index 00000000..88f63ae1 --- /dev/null +++ b/docs/components/sniffs/PHP50.md @@ -0,0 +1,10 @@ + +# PHP 5.0 + +| Sniff category | Sniff class name | PHP Feature | +|----------------|--------------------------|---------------------------------------| +| Classes | MethodDeclarationSniff | [Method Visibility][MethodVisibility] | +| Classes | PropertyDeclarationSniff | [Properties][Properties] | + +[MethodVisibility]: https://www.php.net/manual/en/language.oop5.visibility.php#language.oop5.visiblity-methods +[Properties]: https://www.php.net/manual/en/language.oop5.properties.php diff --git a/docs/components/sniffs/PHP51.md b/docs/components/sniffs/PHP51.md new file mode 100644 index 00000000..57f958fb --- /dev/null +++ b/docs/components/sniffs/PHP51.md @@ -0,0 +1,8 @@ + +# PHP 5.1 + +| Sniff category | Sniff class name | PHP Feature | +|----------------|-------------------|---------------------------------| +| Classes | MagicMethodsSniff | [Magic Methods][MagicMethods51] | + +[MagicMethods51]: https://www.php.net/manual/en/language.oop5.magic.php diff --git a/docs/components/sniffs/PHP52.md b/docs/components/sniffs/PHP52.md new file mode 100644 index 00000000..5156b358 --- /dev/null +++ b/docs/components/sniffs/PHP52.md @@ -0,0 +1,6 @@ + +# PHP 5.2 + +| Sniff category | Sniff class name | PHP Feature | +|----------------|------------------|-------------| +| | | | diff --git a/docs/components/sniffs/PHP53.md b/docs/components/sniffs/PHP53.md new file mode 100644 index 00000000..cb4a7de3 --- /dev/null +++ b/docs/components/sniffs/PHP53.md @@ -0,0 +1,24 @@ + +# PHP 5.3 + +| Sniff category | Sniff class name | PHP Feature | +|----------------------|---------------------------|------------------------------------------------------| +| Classes | MagicMethodsSniff | [Magic Methods][MagicMethods53] | +| Classes | DynamicAccessSniff | Dynamic Static Method access | +| Classes | DynamicAccessSniff | Dynamic Static Property access | +| ControlStructures | DeclareSniff | [Declare][Declare53] | +| ControlStructures | GotoSniff | [Goto][Goto] | +| FunctionDeclarations | ClosureSniff | [Anonymous functions][AnonymousFunctions] | +| | `VersionResolverVisitor` | [Closures][Closures] | +| Operators | ShortTernaryOperatorSniff | [Ternary Operator][ShortTernaryOperator] | +| | `VersionResolverVisitor` | [Namespaces][Namespaces] | +| TextProcessing | CryptStringSniff | [CRYPT_BLOWFISH security fix details][CryptBlowfish] | + +[MagicMethods53]: https://www.php.net/manual/en/language.oop5.magic.php +[Declare53]: https://www.php.net/manual/en/control-structures.declare.php +[Goto]: https://www.php.net/manual/en/control-structures.goto.php +[AnonymousFunctions]: https://www.php.net/manual/en/functions.anonymous.php +[Closures]: https://www.php.net/manual/en/functions.anonymous.php +[ShortTernaryOperator]: https://www.php.net/manual/en/language.operators.comparison.php#language.operators.comparison.ternary +[Namespaces]: https://www.php.net/manual/en/language.namespaces.php +[CryptBlowfish]: https://www.php.net/security/crypt_blowfish.php diff --git a/docs/components/sniffs/PHP54.md b/docs/components/sniffs/PHP54.md new file mode 100644 index 00000000..91a61e2c --- /dev/null +++ b/docs/components/sniffs/PHP54.md @@ -0,0 +1,19 @@ + +# PHP 5.4 + +| Sniff category | Sniff class name | PHP Feature | +|-----------------|-------------------------------|-----------------------------------------------------------| +| Arrays | ArrayDereferencingSyntaxSniff | [Array dereferencing][ArrayDereferencingSyntax] | +| Arrays | ShortArraySyntaxSniff | [Short array syntax][ShortArraySyntax] | +| Classes | ClassMemberAccessSniff | [Class member access on instantiation][ClassMemberAccess] | +| Expressions | ClassExprSyntaxSniff | [Class::{expr}() syntax][ClassExprSyntax] | +| Numbers | BinaryNumberFormatSniff | [Binary number format][BinaryNumberFormat] | +| UseDeclarations | UseTraitSniff | [Traits][UseTrait] | +| | `VersionResolverVisitor` | [Traits][UseTrait] | + +[ArrayDereferencingSyntax]: https://www.php.net/manual/en/migration54.new-features.php +[ShortArraySyntax]: https://www.php.net/manual/en/migration54.new-features.php +[ClassMemberAccess]: https://wiki.php.net/rfc/instance-method-call +[ClassExprSyntax]: https://www.php.net/manual/en/migration54.new-features.php +[BinaryNumberFormat]: https://www.php.net/manual/en/migration54.new-features.php +[UseTrait]: https://www.php.net/manual/en/language.oop5.traits.php diff --git a/docs/components/sniffs/PHP55.md b/docs/components/sniffs/PHP55.md new file mode 100644 index 00000000..f04b7aa3 --- /dev/null +++ b/docs/components/sniffs/PHP55.md @@ -0,0 +1,12 @@ + +# PHP 5.5 + +| Sniff category | Sniff class name | PHP Feature | +|----------------|-------------------------|-------------------------------------------------| +| Constants | MagicClassConstantSniff | [::class syntax][MagicClass] | +| Expressions | EmptySniff | [empty() supports arbitrary expressions][Empty] | +| Generators | GeneratorSniff | [Generators][Generators] | + +[MagicClass]: https://wiki.php.net/rfc/class_name_literal_on_object +[Empty]: https://www.php.net/manual/en/migration55.new-features.php#migration55.new-features.empty +[Generators]: https://www.php.net/manual/en/language.generators.php diff --git a/docs/components/sniffs/PHP56.md b/docs/components/sniffs/PHP56.md new file mode 100644 index 00000000..fa36f564 --- /dev/null +++ b/docs/components/sniffs/PHP56.md @@ -0,0 +1,14 @@ + +# PHP 5.6 + +| Sniff category | Sniff class name | PHP Feature | +|-----------------|-----------------------|------------------------------------------------| +| Classes | MagicMethodsSniff | [Magic Methods][MagicMethods56] | +| Constants | ConstSyntaxSniff | [Constant Expressions][ConstScalar] | +| Operators | PowOperatorSniff | [Exponentiation][PowOperator] | +| UseDeclarations | UseConstFunctionSniff | [use function and use const][UseConstFunction] | + +[MagicMethods56]: https://www.php.net/manual/en/language.oop5.magic.php +[ConstScalar]: https://www.php.net/manual/en/migration56.new-features.php#migration56.new-features.const-scalar-exprs +[PowOperator]: https://www.php.net/manual/en/migration56.new-features.php#migration56.new-features.exponentiation +[UseConstFunction]: https://www.php.net/manual/en/migration56.new-features.php#migration56.new-features.use diff --git a/docs/components/sniffs/PHP70.md b/docs/components/sniffs/PHP70.md new file mode 100644 index 00000000..2c74e5ad --- /dev/null +++ b/docs/components/sniffs/PHP70.md @@ -0,0 +1,26 @@ + +# PHP 7.0 + +| Sniff category | Sniff class name | PHP Feature | +|----------------------|---------------------------------|----------------------------------------------------| +| FunctionDeclarations | ParamTypeDeclarationSniff | [Scalar type declarations][ScalarTypeDeclarations] | +| FunctionDeclarations | ReturnTypeDeclarationSniff | [Return type declarations][ReturnTypeDeclarations] | +| Keywords | ReservedSniff | [Scalar type declarations][ScalarTypeDeclarations] | +| Operators | NullCoalesceOperatorSniff | [Null coalescing operator][NullCoalesceOperator] | +| Operators | CombinedComparisonOperatorSniff | [Spaceship operator][SpaceshipOperator] | +| | | [Constant arrays using define()][DefineArray] | +| Classes | AnonymousClassSniff | [Anonymous classes][AnonymousClass] | +| Classes | ClassMemberAccessSniff | Class member access on cloning | +| ControlStructures | DeclareSniff | [Declare][Declare70] | +| Generators | GeneratorSniff | [Generator Return Expressions][GeneratorReturn] | +| Generators | GeneratorSniff | [Generator Delegation][GeneratorDelegation] | + +[ScalarTypeDeclarations]: https://www.php.net/manual/en/migration70.new-features.php#migration70.new-features.scalar-type-declarations +[ReturnTypeDeclarations]: https://www.php.net/manual/en/migration70.new-features.php#migration70.new-features.return-type-declarations +[NullCoalesceOperator]: https://www.php.net/manual/en/migration70.new-features.php#migration70.new-features.null-coalesce-op +[SpaceshipOperator]: https://www.php.net/manual/en/migration70.new-features.php#migration70.new-features.spaceship-op +[DefineArray]: https://www.php.net/manual/en/migration70.new-features.php#migration70.new-features.define-array +[AnonymousClass]: https://www.php.net/manual/en/migration70.new-features.php#migration70.new-features.anonymous-classes +[Declare70]: https://www.php.net/manual/en/control-structures.declare.php +[GeneratorReturn]: https://www.php.net/manual/en/migration70.new-features.php#migration70.new-features.generator-return-expressions +[GeneratorDelegation]: https://www.php.net/manual/en/language.generators.syntax.php#control-structures.yield.from diff --git a/docs/components/sniffs/PHP71.md b/docs/components/sniffs/PHP71.md new file mode 100644 index 00000000..6d8b55e3 --- /dev/null +++ b/docs/components/sniffs/PHP71.md @@ -0,0 +1,22 @@ + +# PHP 7.1 + +| Sniff category | Sniff class name | PHP Feature | +|----------------------|----------------------------|--------------------------------------------------------------| +| FunctionDeclarations | ParamTypeDeclarationSniff | [Nullable types][NullableTypes] | +| FunctionDeclarations | ReturnTypeDeclarationSniff | [Nullable types][NullableTypes] | +| FunctionDeclarations | ReturnTypeDeclarationSniff | [Void functions][VoidFunctions] | +| | | [Symmetric array destructuring][SymmetricArrayDestructuring] | +| | | [Class constant visibility][ClassConstantVisibility] | +| FunctionDeclarations | ParamTypeDeclarationSniff | [iterable pseudo-type][IterableType] | +| Keywords | ReservedSniff | [iterable pseudo-type][IterableType] | +| | | [Multi catch exception handling][MultiCatchException] | +| | | [Support for keys in list()][SupportKeysInList] | + +[NullableTypes]: https://www.php.net/manual/en/migration71.new-features.php#migration71.new-features.nullable-types +[VoidFunctions]: https://www.php.net/manual/en/migration71.new-features.php#migration71.new-features.void-functions +[SymmetricArrayDestructuring]: https://www.php.net/manual/en/migration71.new-features.php#migration71.new-features.symmetric-array-destructuring +[ClassConstantVisibility]: https://www.php.net/manual/en/migration71.new-features.php#migration71.new-features.class-constant-visibility +[IterableType]: https://www.php.net/manual/en/migration71.new-features.php#migration71.new-features.iterable-pseudo-type +[MultiCatchException]: https://www.php.net/manual/en/migration71.new-features.php#migration71.new-features.mulit-catch-exception-handling +[SupportKeysInList]: https://www.php.net/manual/en/migration71.new-features.php#migration71.new-features.support-for-keys-in-list diff --git a/docs/components/sniffs/PHP72.md b/docs/components/sniffs/PHP72.md new file mode 100644 index 00000000..1803f7ab --- /dev/null +++ b/docs/components/sniffs/PHP72.md @@ -0,0 +1,8 @@ + +# PHP 7.2 + +| Sniff category | Sniff class name | PHP Feature | +|----------------|------------------|---------------------------------------| +| Keywords | ReservedSniff | [New object type][ReservedKeywords72] | + +[ReservedKeywords72]: https://www.php.net/manual/en/migration72.new-features.php#migration72.new-features.object-type diff --git a/docs/components/sniffs/PHP73.md b/docs/components/sniffs/PHP73.md new file mode 100644 index 00000000..10c7a06b --- /dev/null +++ b/docs/components/sniffs/PHP73.md @@ -0,0 +1,8 @@ + +# PHP 7.3 + +| Sniff category | Sniff class name | PHP Feature | +|----------------|---------------------|------------------------------------------------------| +| FunctionCalls | SameSiteCookieSniff | [SetCookie accept $options argument][SameSiteCookie] | + +[SameSiteCookie]: https://www.php.net/manual/en/migration73.other-changes.php#migration73.other-changes.core.setcookie diff --git a/docs/components/sniffs/PHP74.md b/docs/components/sniffs/PHP74.md new file mode 100644 index 00000000..9efd5b31 --- /dev/null +++ b/docs/components/sniffs/PHP74.md @@ -0,0 +1,13 @@ + +# PHP 7.4 + +| Sniff category | Sniff class name | PHP Feature | +|----------------------|---------------------------|----------------------------------------------------------------------------| +| Arrays | ArrayUnpackingSyntaxSniff | [Array unpacking support for numeric-keyed arrays][ArrayUnpackingSyntax74] | +| Classes | TypedPropertySniff | [Typed properties][TypedProperties] | +| FunctionDeclarations | ArrowFunctionSniff | [Arrow functions][ArrowFunctions] | +| | `VersionResolverVisitor` | [Arrow functions][ArrowFunctions] | + +[ArrayUnpackingSyntax74]: https://www.php.net/manual/en/migration74.new-features.php#migration74.new-features.core.unpack-inside-array +[TypedProperties]: https://www.php.net/manual/en/migration74.new-features.php#migration74.new-features.core.typed-properties +[ArrowFunctions]: https://www.php.net/manual/en/migration74.new-features.php#migration74.new-features.core.arrow-functions diff --git a/docs/components/sniffs/PHP80.md b/docs/components/sniffs/PHP80.md new file mode 100644 index 00000000..959860d1 --- /dev/null +++ b/docs/components/sniffs/PHP80.md @@ -0,0 +1,22 @@ + +# PHP 8.0 + +| Sniff category | Sniff class name | PHP Feature | +|----------------------|-------------------------------|-----------------------------------------------------| +| Attributes | AttributeSniff | [Attributes][Attributes] | +| Classes | PropertyPromotionSniff | [Constructor property promotion][PropertyPromotion] | +| ControlStructures | MatchSniff | [Match expressions][Match] | +| ControlStructures | NonCapturingCatchSniff | [Non-capturing catches][NonCapturingCatch] | +| FunctionDeclarations | NamedArgumentDeclarationSniff | [Named arguments][NamedArgumentDeclaration] | +| FunctionDeclarations | ParamTypeDeclarationSniff | [Union types][UnionTypes] | +| FunctionDeclarations | TrailingCommaSniff | [Trailing comma][TrailingComma] | +| Operators | NullsafeOperatorSniff | [Nullsafe operator][NullsafeOperator] | + +[Attributes]: https://www.php.net/releases/8.0/en.php#attributes +[PropertyPromotion]: https://www.php.net/releases/8.0/en.php#constructor-property-promotion +[Match]: https://www.php.net/releases/8.0/en.php#match-expression +[NonCapturingCatch]: https://wiki.php.net/rfc/non-capturing_catches +[NamedArgumentDeclaration]: https://www.php.net/releases/8.0/en.php#named-arguments +[UnionTypes]: https://www.php.net/releases/8.0/en.php#union-types +[TrailingComma]: https://php.watch/versions/8.0/trailing-comma-parameter-use-list +[NullsafeOperator]: https://www.php.net/releases/8.0/en.php#nullsafe-operator diff --git a/docs/components/sniffs/PHP81.md b/docs/components/sniffs/PHP81.md new file mode 100644 index 00000000..07cc9176 --- /dev/null +++ b/docs/components/sniffs/PHP81.md @@ -0,0 +1,27 @@ + +# PHP 8.1 + +| Sniff category | Sniff class name | PHP Feature | +|----------------------|----------------------------|---------------------------------------------------------------------------| +| Arrays | ArrayUnpackingSyntaxSniff | [Array unpacking support for string-keyed arrays][ArrayUnpackingSyntax81] | +| Classes | ReadonlyPropertySniff | [Readonly Properties][ReadonlyProperty] | +| Classes | NewInitializerSniff | [New initializers][NewInitializer] | +| Constants | ClassConstantSniff | [Final class constants][FinalClassConstant] | +| Enumerations | EnumerationSniff | [Enumerations][Enumerations] | +| Fibers | FiberSniff | [Fibers][Fibers] | +| FunctionDeclarations | FirstClassCallableSniff | [First class callable][FirstClassCallable] | +| FunctionDeclarations | ParamTypeDeclarationSniff | [Pure Intersection Types][PureIntersectionTypes] | +| FunctionDeclarations | ReturnTypeDeclarationSniff | [Pure Intersection Types][PureIntersectionTypes] | +| FunctionDeclarations | ReturnTypeDeclarationSniff | [Never return type][NeverReturnType] | +| Numbers | OctalNumberFormatSniff | [Explicit Octal numeral notation][OctalNumberFormat] | + +[ArrayUnpackingSyntax81]: https://www.php.net/releases/8.1/en.php#array_unpacking_support_for_string_keyed_arrays +[ReadonlyProperty]: https://www.php.net/manual/en/language.oop5.properties.php#language.oop5.properties.readonly-properties +[NewInitializer]: https://www.php.net/manual/en/migration81.new-features.php#migration81.new-features.core.new-in-initializer +[FinalClassConstant]: https://www.php.net/releases/8.1/en.php#final_class_constants +[Enumerations]: https://www.php.net/manual/en/migration81.new-features.php#migration81.new-features.core.enums +[Fibers]: https://www.php.net/releases/8.1/en.php#fibers +[FirstClassCallable]: https://www.php.net/manual/en/functions.first_class_callable_syntax.php +[PureIntersectionTypes]: https://www.php.net/releases/8.1/en.php#pure_intersection_types +[NeverReturnType]: https://www.php.net/releases/8.1/en.php#never_return_type +[OctalNumberFormat]: https://www.php.net/releases/8.1/en.php#explicit_octal_numeral_notation diff --git a/docs/components/sniffs/PHP82.md b/docs/components/sniffs/PHP82.md new file mode 100644 index 00000000..c5bf15fe --- /dev/null +++ b/docs/components/sniffs/PHP82.md @@ -0,0 +1,20 @@ + +# PHP 8.2 + +| Sniff category | Sniff class name | PHP Feature | +|----------------------|----------------------------------------------|-----------------------------------------------------------------------------------------| +| Attributes | AllowDynamicPropertiesAttributeSniff | [AllowDynamicProperties attribute][AllowDynamicPropertiesAttribute] | +| Attributes | SensitiveParameterAttributeSniff | [SensitiveParameter attribute][SensitiveParameterAttribute] | +| Classes | ReadonlyClassSniff | [Readonly Classes][ReadonlyClass] | +| Constants | ConstantsInTraitsSniff | [Constants in Traits][ConstantsInTraits] | +| FunctionDeclarations | ParamTypeDeclarationSniff | [Disjunctive Normal Form Types][DisjunctiveNormalFormTypes] | +| FunctionDeclarations | ReturnTypeDeclarationSniff | [Allow null, false, and true as stand-alone types][AllowNullFalseTrueAsStandaloneTypes] | +| TextProcessing | DeprecateDollarBraceStringInterpolationSniff | [Deprecated \${} string interpolation][DeprecateDollarBraceStringInterpolation] | + +[AllowDynamicPropertiesAttribute]: https://www.php.net/manual/en/class.allow-dynamic-properties.php +[SensitiveParameterAttribute]: https://www.php.net/manual/en/class.sensitive-parameter.php +[ReadonlyClass]: https://www.php.net/manual/en/language.oop5.basic.php#language.oop5.basic.class.readonly +[ConstantsInTraits]: https://www.php.net/manual/en/migration82.new-features.php#migration82.new-features.core.constant-in-traits +[DisjunctiveNormalFormTypes]: https://www.php.net/manual/en/migration82.new-features.php#migration82.new-features.core.type-system +[AllowNullFalseTrueAsStandaloneTypes]: https://wiki.php.net/rfc/true-type +[DeprecateDollarBraceStringInterpolation]: https://wiki.php.net/rfc/deprecate_dollar_brace_string_interpolation diff --git a/docs/components/sniffs/PHP83.md b/docs/components/sniffs/PHP83.md new file mode 100644 index 00000000..811da23e --- /dev/null +++ b/docs/components/sniffs/PHP83.md @@ -0,0 +1,14 @@ + +# PHP 8.3 + +| Sniff category | Sniff class name | PHP Feature | +|----------------|--------------------------------|------------------------------------------------------------------| +| Attributes | OverrideAttributeSniff | [Override attribute][OverrideAttribute] | +| Constants | DynamicClassConstantFetchSniff | [Dynamic Class Constant fetch syntax][DynamicClassConstantFetch] | +| Constants | TypedClassConstantSniff | [Typed Class Constants][TypedClassConstant] | +| Expressions | StaticVarInitializerSniff | [Static Variable initializers][StaticVarInitializer] | + +[DynamicClassConstantFetch]: https://www.php.net/releases/8.3/en.php#dynamic_class_constant_fetch +[OverrideAttribute]: https://www.php.net/releases/8.3/en.php#override_attribute +[StaticVarInitializer]: https://www.php.net/manual/en/migration83.new-features.php#migration83.new-features.core.static-variable-initializers +[TypedClassConstant]: https://www.php.net/releases/8.3/en.php#typed_class_constants diff --git a/docs/components/sniffs/PHP84.md b/docs/components/sniffs/PHP84.md new file mode 100644 index 00000000..8f350231 --- /dev/null +++ b/docs/components/sniffs/PHP84.md @@ -0,0 +1,6 @@ + +# PHP 8.4 + +| Sniff category | Sniff class name | PHP Feature | +|----------------|------------------|-------------| +| | | | diff --git a/docs/components/sniffs/README.md b/docs/components/sniffs/README.md index 7b08d186..cfaa35eb 100644 --- a/docs/components/sniffs/README.md +++ b/docs/components/sniffs/README.md @@ -9,258 +9,39 @@ and allows to extend it more easily. Each sniff, is in charge to detect a PHP language feature. Here is the list of features supported and their corresponding sniffs : -## [PHP 5.0](https://www.php.net/manual/en/migration50.php) +## [PHP 5.0](PHP50.md) -| Sniff category | Sniff class name | PHP Feature | -|----------------|--------------------------|---------------------------------------| -| Classes | MethodDeclarationSniff | [Method Visibility][MethodVisibility] | -| Classes | PropertyDeclarationSniff | [Properties][Properties] | +## [PHP 5.1](PHP51.md) -[MethodVisibility]: https://www.php.net/manual/en/language.oop5.visibility.php#language.oop5.visiblity-methods -[Properties]: https://www.php.net/manual/en/language.oop5.properties.php +## [PHP 5.2](PHP52.md) -## [PHP 5.1](https://www.php.net/manual/en/migration51.php) +## [PHP 5.3](PHP53.md) -| Sniff category | Sniff class name | PHP Feature | -|----------------|-------------------|---------------------------------| -| Classes | MagicMethodsSniff | [Magic Methods][MagicMethods51] | +## [PHP 5.4](PHP54.md) -[MagicMethods51]: https://www.php.net/manual/en/language.oop5.magic.php +## [PHP 5.5](PHP55.md) -## [PHP 5.2](https://www.php.net/manual/en/migration52.php) +## [PHP 5.6](PHP56.md) -| Sniff category | Sniff class name | PHP Feature | -|----------------|------------------|-------------| -| | | | +## [PHP 7.0](PHP70.md) -## [PHP 5.3](https://www.php.net/manual/en/migration53.php) +## [PHP 7.1](PHP71.md) -| Sniff category | Sniff class name | PHP Feature | -|----------------------|---------------------------|------------------------------------------------------| -| Classes | MagicMethodsSniff | [Magic Methods][MagicMethods53] | -| Classes | DynamicAccessSniff | Dynamic Static Method access | -| Classes | DynamicAccessSniff | Dynamic Static Property access | -| ControlStructures | DeclareSniff | [Declare][Declare53] | -| ControlStructures | GotoSniff | [Goto][Goto] | -| FunctionDeclarations | ClosureSniff | [Anonymous functions][AnonymousFunctions] | -| | `VersionResolverVisitor` | [Closures][Closures] | -| Operators | ShortTernaryOperatorSniff | [Ternary Operator][ShortTernaryOperator] | -| | `VersionResolverVisitor` | [Namespaces][Namespaces] | -| TextProcessing | CryptStringSniff | [CRYPT_BLOWFISH security fix details][CryptBlowfish] | +## [PHP 7.2](PHP72.md) -[MagicMethods53]: https://www.php.net/manual/en/language.oop5.magic.php -[Declare53]: https://www.php.net/manual/en/control-structures.declare.php -[Goto]: https://www.php.net/manual/en/control-structures.goto.php -[AnonymousFunctions]: https://www.php.net/manual/en/functions.anonymous.php -[Closures]: https://www.php.net/manual/en/functions.anonymous.php -[ShortTernaryOperator]: https://www.php.net/manual/en/language.operators.comparison.php#language.operators.comparison.ternary -[Namespaces]: https://www.php.net/manual/en/language.namespaces.php -[CryptBlowfish]: https://www.php.net/security/crypt_blowfish.php +## [PHP 7.3](PHP73.md) -## [PHP 5.4](https://www.php.net/manual/en/migration54.php) +## [PHP 7.4](PHP74.md) -| Sniff category | Sniff class name | PHP Feature | -|-----------------|-------------------------------|-----------------------------------------------------------| -| Arrays | ArrayDereferencingSyntaxSniff | [Array dereferencing][ArrayDereferencingSyntax] | -| Arrays | ShortArraySyntaxSniff | [Short array syntax][ShortArraySyntax] | -| Classes | ClassMemberAccessSniff | [Class member access on instantiation][ClassMemberAccess] | -| Expressions | ClassExprSyntaxSniff | [Class::{expr}() syntax][ClassExprSyntax] | -| Numbers | BinaryNumberFormatSniff | [Binary number format][BinaryNumberFormat] | -| UseDeclarations | UseTraitSniff | [Traits][UseTrait] | -| | `VersionResolverVisitor` | [Traits][UseTrait] | +## [PHP 8.0](PHP80.md) -[ArrayDereferencingSyntax]: https://www.php.net/manual/en/migration54.new-features.php -[ShortArraySyntax]: https://www.php.net/manual/en/migration54.new-features.php -[ClassMemberAccess]: https://wiki.php.net/rfc/instance-method-call -[ClassExprSyntax]: https://www.php.net/manual/en/migration54.new-features.php -[BinaryNumberFormat]: https://www.php.net/manual/en/migration54.new-features.php -[UseTrait]: https://www.php.net/manual/en/language.oop5.traits.php +## [PHP 8.1](PHP81.md) -## [PHP 5.5](https://www.php.net/manual/en/migration55.php) +## [PHP 8.2](PHP82.md) -| Sniff category | Sniff class name | PHP Feature | -|----------------|-------------------------|-------------------------------------------------| -| Constants | MagicClassConstantSniff | [::class syntax][MagicClass] | -| Expressions | EmptySniff | [empty() supports arbitrary expressions][Empty] | -| Generators | GeneratorSniff | [Generators][Generators] | +## [PHP 8.3](PHP83.md) -[MagicClass]: https://wiki.php.net/rfc/class_name_literal_on_object -[Empty]: https://www.php.net/manual/en/migration55.new-features.php#migration55.new-features.empty -[Generators]: https://www.php.net/manual/en/language.generators.php - -## [PHP 5.6](https://www.php.net/manual/en/migration56.php) - -| Sniff category | Sniff class name | PHP Feature | -|-----------------|-----------------------|------------------------------------------------| -| Classes | MagicMethodsSniff | [Magic Methods][MagicMethods56] | -| Constants | ConstSyntaxSniff | [Constant Expressions][ConstScalar] | -| Operators | PowOperatorSniff | [Exponentiation][PowOperator] | -| UseDeclarations | UseConstFunctionSniff | [use function and use const][UseConstFunction] | - -[MagicMethods56]: https://www.php.net/manual/en/language.oop5.magic.php -[ConstScalar]: https://www.php.net/manual/en/migration56.new-features.php#migration56.new-features.const-scalar-exprs -[PowOperator]: https://www.php.net/manual/en/migration56.new-features.php#migration56.new-features.exponentiation -[UseConstFunction]: https://www.php.net/manual/en/migration56.new-features.php#migration56.new-features.use - -## [PHP 7.0](https://www.php.net/manual/en/migration70.php) - -| Sniff category | Sniff class name | PHP Feature | -|----------------------|---------------------------------|----------------------------------------------------| -| FunctionDeclarations | ParamTypeDeclarationSniff | [Scalar type declarations][ScalarTypeDeclarations] | -| FunctionDeclarations | ReturnTypeDeclarationSniff | [Return type declarations][ReturnTypeDeclarations] | -| Keywords | ReservedSniff | [Scalar type declarations][ScalarTypeDeclarations] | -| Operators | NullCoalesceOperatorSniff | [Null coalescing operator][NullCoalesceOperator] | -| Operators | CombinedComparisonOperatorSniff | [Spaceship operator][SpaceshipOperator] | -| | | [Constant arrays using define()][DefineArray] | -| Classes | AnonymousClassSniff | [Anonymous classes][AnonymousClass] | -| Classes | ClassMemberAccessSniff | Class member access on cloning | -| ControlStructures | DeclareSniff | [Declare][Declare70] | -| Generators | GeneratorSniff | [Generator Return Expressions][GeneratorReturn] | -| Generators | GeneratorSniff | [Generator Delegation][GeneratorDelegation] | - -[ScalarTypeDeclarations]: https://www.php.net/manual/en/migration70.new-features.php#migration70.new-features.scalar-type-declarations -[ReturnTypeDeclarations]: https://www.php.net/manual/en/migration70.new-features.php#migration70.new-features.return-type-declarations -[NullCoalesceOperator]: https://www.php.net/manual/en/migration70.new-features.php#migration70.new-features.null-coalesce-op -[SpaceshipOperator]: https://www.php.net/manual/en/migration70.new-features.php#migration70.new-features.spaceship-op -[DefineArray]: https://www.php.net/manual/en/migration70.new-features.php#migration70.new-features.define-array -[AnonymousClass]: https://www.php.net/manual/en/migration70.new-features.php#migration70.new-features.anonymous-classes -[Declare70]: https://www.php.net/manual/en/control-structures.declare.php -[GeneratorReturn]: https://www.php.net/manual/en/migration70.new-features.php#migration70.new-features.generator-return-expressions -[GeneratorDelegation]: https://www.php.net/manual/en/language.generators.syntax.php#control-structures.yield.from - -## [PHP 7.1](https://www.php.net/manual/en/migration71.php) - -| Sniff category | Sniff class name | PHP Feature | -|----------------------|----------------------------|--------------------------------------------------------------| -| FunctionDeclarations | ParamTypeDeclarationSniff | [Nullable types][NullableTypes] | -| FunctionDeclarations | ReturnTypeDeclarationSniff | [Nullable types][NullableTypes] | -| FunctionDeclarations | ReturnTypeDeclarationSniff | [Void functions][VoidFunctions] | -| | | [Symmetric array destructuring][SymmetricArrayDestructuring] | -| | | [Class constant visibility][ClassConstantVisibility] | -| FunctionDeclarations | ParamTypeDeclarationSniff | [iterable pseudo-type][IterableType] | -| Keywords | ReservedSniff | [iterable pseudo-type][IterableType] | -| | | [Multi catch exception handling][MultiCatchException] | -| | | [Support for keys in list()][SupportKeysInList] | - -[NullableTypes]: https://www.php.net/manual/en/migration71.new-features.php#migration71.new-features.nullable-types -[VoidFunctions]: https://www.php.net/manual/en/migration71.new-features.php#migration71.new-features.void-functions -[SymmetricArrayDestructuring]: https://www.php.net/manual/en/migration71.new-features.php#migration71.new-features.symmetric-array-destructuring -[ClassConstantVisibility]: https://www.php.net/manual/en/migration71.new-features.php#migration71.new-features.class-constant-visibility -[IterableType]: https://www.php.net/manual/en/migration71.new-features.php#migration71.new-features.iterable-pseudo-type -[MultiCatchException]: https://www.php.net/manual/en/migration71.new-features.php#migration71.new-features.mulit-catch-exception-handling -[SupportKeysInList]: https://www.php.net/manual/en/migration71.new-features.php#migration71.new-features.support-for-keys-in-list - -## [PHP 7.2](https://www.php.net/manual/en/migration72.php) - -| Sniff category | Sniff class name | PHP Feature | -|----------------|------------------|---------------------------------------| -| Keywords | ReservedSniff | [New object type][ReservedKeywords72] | - -[ReservedKeywords72]: https://www.php.net/manual/en/migration72.new-features.php#migration72.new-features.object-type - -## [PHP 7.3](https://www.php.net/manual/en/migration73.php) - -| Sniff category | Sniff class name | PHP Feature | -|----------------|---------------------|------------------------------------------------------| -| FunctionCalls | SameSiteCookieSniff | [SetCookie accept $options argument][SameSiteCookie] | - -[SameSiteCookie]: https://www.php.net/manual/en/migration73.other-changes.php#migration73.other-changes.core.setcookie - -## [PHP 7.4](https://www.php.net/manual/en/migration74.php) - -| Sniff category | Sniff class name | PHP Feature | -|----------------------|---------------------------|----------------------------------------------------------------------------| -| Arrays | ArrayUnpackingSyntaxSniff | [Array unpacking support for numeric-keyed arrays][ArrayUnpackingSyntax74] | -| Classes | TypedPropertySniff | [Typed properties][TypedProperties] | -| FunctionDeclarations | ArrowFunctionSniff | [Arrow functions][ArrowFunctions] | -| | `VersionResolverVisitor` | [Arrow functions][ArrowFunctions] | - -[ArrayUnpackingSyntax74]: https://www.php.net/manual/en/migration74.new-features.php#migration74.new-features.core.unpack-inside-array -[TypedProperties]: https://www.php.net/manual/en/migration74.new-features.php#migration74.new-features.core.typed-properties -[ArrowFunctions]: https://www.php.net/manual/en/migration74.new-features.php#migration74.new-features.core.arrow-functions - -## [PHP 8.0](https://www.php.net/manual/en/migration80.php) - -| Sniff category | Sniff class name | PHP Feature | -|----------------------|-------------------------------|-----------------------------------------------------| -| Attributes | AttributeSniff | [Attributes][Attributes] | -| Classes | PropertyPromotionSniff | [Constructor property promotion][PropertyPromotion] | -| ControlStructures | MatchSniff | [Match expressions][Match] | -| ControlStructures | NonCapturingCatchSniff | [Non-capturing catches][NonCapturingCatch] | -| FunctionDeclarations | NamedArgumentDeclarationSniff | [Named arguments][NamedArgumentDeclaration] | -| FunctionDeclarations | ParamTypeDeclarationSniff | [Union types][UnionTypes] | -| FunctionDeclarations | TrailingCommaSniff | [Trailing comma][TrailingComma] | -| Operators | NullsafeOperatorSniff | [Nullsafe operator][NullsafeOperator] | - -[Attributes]: https://www.php.net/releases/8.0/en.php#attributes -[PropertyPromotion]: https://www.php.net/releases/8.0/en.php#constructor-property-promotion -[Match]: https://www.php.net/releases/8.0/en.php#match-expression -[NonCapturingCatch]: https://wiki.php.net/rfc/non-capturing_catches -[NamedArgumentDeclaration]: https://www.php.net/releases/8.0/en.php#named-arguments -[UnionTypes]: https://www.php.net/releases/8.0/en.php#union-types -[TrailingComma]: https://php.watch/versions/8.0/trailing-comma-parameter-use-list -[NullsafeOperator]: https://www.php.net/releases/8.0/en.php#nullsafe-operator - -## [PHP 8.1](https://www.php.net/manual/en/migration81.php) - -| Sniff category | Sniff class name | PHP Feature | -|----------------------|----------------------------|---------------------------------------------------------------------------| -| Arrays | ArrayUnpackingSyntaxSniff | [Array unpacking support for string-keyed arrays][ArrayUnpackingSyntax81] | -| Classes | ReadonlyPropertySniff | [Readonly Properties][ReadonlyProperty] | -| Classes | NewInitializerSniff | [New initializers][NewInitializer] | -| Constants | ClassConstantSniff | [Final class constants][FinalClassConstant] | -| Enumerations | EnumerationSniff | [Enumerations][Enumerations] | -| Fibers | FiberSniff | [Fibers][Fibers] | -| FunctionDeclarations | FirstClassCallableSniff | [First class callable][FirstClassCallable] | -| FunctionDeclarations | ParamTypeDeclarationSniff | [Pure Intersection Types][PureIntersectionTypes] | -| FunctionDeclarations | ReturnTypeDeclarationSniff | [Pure Intersection Types][PureIntersectionTypes] | -| FunctionDeclarations | ReturnTypeDeclarationSniff | [Never return type][NeverReturnType] | -| Numbers | OctalNumberFormatSniff | [Explicit Octal numeral notation][OctalNumberFormat] | - -[ArrayUnpackingSyntax81]: https://www.php.net/releases/8.1/en.php#array_unpacking_support_for_string_keyed_arrays -[ReadonlyProperty]: https://www.php.net/manual/en/language.oop5.properties.php#language.oop5.properties.readonly-properties -[NewInitializer]: https://www.php.net/manual/en/migration81.new-features.php#migration81.new-features.core.new-in-initializer -[FinalClassConstant]: https://www.php.net/releases/8.1/en.php#final_class_constants -[Enumerations]: https://www.php.net/manual/en/migration81.new-features.php#migration81.new-features.core.enums -[Fibers]: https://www.php.net/releases/8.1/en.php#fibers -[FirstClassCallable]: https://www.php.net/manual/en/functions.first_class_callable_syntax.php -[PureIntersectionTypes]: https://www.php.net/releases/8.1/en.php#pure_intersection_types -[NeverReturnType]: https://www.php.net/releases/8.1/en.php#never_return_type -[OctalNumberFormat]: https://www.php.net/releases/8.1/en.php#explicit_octal_numeral_notation - -## [PHP 8.2](https://www.php.net/manual/en/migration82.php) - -| Sniff category | Sniff class name | PHP Feature | -|----------------------|----------------------------------------------|-----------------------------------------------------------------------------------------| -| Attributes | AllowDynamicPropertiesAttributeSniff | [AllowDynamicProperties attribute][AllowDynamicPropertiesAttribute] | -| Attributes | SensitiveParameterAttributeSniff | [SensitiveParameter attribute][SensitiveParameterAttribute] | -| Classes | ReadonlyClassSniff | [Readonly Classes][ReadonlyClass] | -| Constants | ConstantsInTraitsSniff | [Constants in Traits][ConstantsInTraits] | -| FunctionDeclarations | ParamTypeDeclarationSniff | [Disjunctive Normal Form Types][DisjunctiveNormalFormTypes] | -| FunctionDeclarations | ReturnTypeDeclarationSniff | [Allow null, false, and true as stand-alone types][AllowNullFalseTrueAsStandaloneTypes] | -| TextProcessing | DeprecateDollarBraceStringInterpolationSniff | [Deprecated \${} string interpolation][DeprecateDollarBraceStringInterpolation] | - -[AllowDynamicPropertiesAttribute]: https://www.php.net/manual/en/class.allow-dynamic-properties.php -[SensitiveParameterAttribute]: https://www.php.net/manual/en/class.sensitive-parameter.php -[ReadonlyClass]: https://www.php.net/manual/en/language.oop5.basic.php#language.oop5.basic.class.readonly -[ConstantsInTraits]: https://www.php.net/manual/en/migration82.new-features.php#migration82.new-features.core.constant-in-traits -[DisjunctiveNormalFormTypes]: https://www.php.net/manual/en/migration82.new-features.php#migration82.new-features.core.type-system -[AllowNullFalseTrueAsStandaloneTypes]: https://wiki.php.net/rfc/true-type -[DeprecateDollarBraceStringInterpolation]: https://wiki.php.net/rfc/deprecate_dollar_brace_string_interpolation - -## [PHP 8.3](https://www.php.net/manual/en/migration83.php) - -| Sniff category | Sniff class name | PHP Feature | -|----------------|--------------------------------|------------------------------------------------------------------| -| Attributes | OverrideAttributeSniff | [Override attribute][OverrideAttribute] | -| Constants | DynamicClassConstantFetchSniff | [Dynamic Class Constant fetch syntax][DynamicClassConstantFetch] | -| Constants | TypedClassConstantSniff | [Typed Class Constants][TypedClassConstant] | -| Expressions | StaticVarInitializerSniff | [Static Variable initializers][StaticVarInitializer] | - -[DynamicClassConstantFetch]: https://www.php.net/releases/8.3/en.php#dynamic_class_constant_fetch -[OverrideAttribute]: https://www.php.net/releases/8.3/en.php#override_attribute -[StaticVarInitializer]: https://www.php.net/manual/en/migration83.new-features.php#migration83.new-features.core.static-variable-initializers -[TypedClassConstant]: https://www.php.net/releases/8.3/en.php#typed_class_constants +## [PHP 8.4](PHP84.md) ## Special cases