HumHub Documentation (unofficial)

PHPCompatibility

Table of Contents

Interfaces

ComplexVersionInterface
Complex Version Interface.

Classes

AbstractComplexVersionSniff
Abstract base class for sniffs based on complex arrays with PHP version information.
AbstractFunctionCallParameterSniff
Abstract class to use as a base for examining the parameter values passed to function calls.
AbstractNewFeatureSniff
Base class for new feature sniffs.
AbstractRemovedFeatureSniff
Base class for removed feature sniffs.
PHPCSHelper
PHPCS cross-version compatibility helper class.
Sniff
Base class from which all PHPCompatibility sniffs extend.
ForbiddenAbstractPrivateMethodsSniff
Abstract private methods are not allowed since PHP 5.1.
NewAnonymousClassesSniff
Anonymous classes are supported since PHP 7.0.
NewClassesSniff
Detect use of new PHP native classes.
NewConstVisibilitySniff
Visibility for class constants is available since PHP 7.1.
NewLateStaticBindingSniff
Detect use of late static binding as introduced in PHP 5.3.
NewTypedPropertiesSniff
Typed class property declarations are available since PHP 7.4.
RemovedOrphanedParentSniff
Using `parent` inside a class without parent is deprecated since PHP 7.4.
NewConstantsSniff
Detect use of new PHP native global constants.
NewMagicClassConstantSniff
Detect usage of the magic `::class` constant introduced in PHP 5.5.
RemovedConstantsSniff
Detect use of deprecated and/or removed PHP native global constants.
DiscouragedSwitchContinueSniff
Detect use of `continue` in `switch` control structures.
ForbiddenBreakContinueOutsideLoopSniff
Detect using `break` and/or `continue` statements outside of a looping structure.
ForbiddenBreakContinueVariableArgumentsSniff
Detects using 0 and variable numeric arguments on `break` and `continue` statements.
ForbiddenSwitchWithMultipleDefaultBlocksSniff
Switch statements can not have multiple default blocks since PHP 7.0.
NewExecutionDirectivesSniff
Check for valid execution directives set with `declare()`.
NewForeachExpressionReferencingSniff
Detect `foreach` expression referencing.
NewListInForeachSniff
Detect unpacking nested arrays with `list()` in a `foreach()` as available since PHP 5.5.
NewMultiCatchSniff
Catching multiple exception types in one statement is available since PHP 7.1.
RemovedExtensionsSniff
Detect the use of deprecated and/or removed PHP extensions.
ForbiddenParameterShadowSuperGlobalsSniff
Detect the use of superglobals as parameters for functions, support for which was removed in PHP 5.4.
ForbiddenParametersWithSameNameSniff
Functions can not have multiple parameters with the same name since PHP 7.0.
ForbiddenToStringParametersSniff
As of PHP 5.3, the __toString() magic method can no longer accept arguments.
ForbiddenVariableNamesInClosureUseSniff
Detect variable names forbidden to be used in closure `use` statements.
NewClosureSniff
Detect closures and verify that the features used are supported.
NewExceptionsFromToStringSniff
As of PHP 7.4, throwing exceptions from a `__toString()` method is allowed.
NewNullableTypesSniff
Nullable parameter type declarations and return types are available since PHP 7.1.
NewParamTypeDeclarationsSniff
Detect and verify the use of parameter type declarations in function declarations.
NewReturnTypeDeclarationsSniff
Detect and verify the use of return type declarations in function declarations.
NonStaticMagicMethodsSniff
Verifies the use of the correct visibility and static properties of magic methods.
NewMagicMethodsSniff
Warns for non-magic behaviour of magic methods prior to becoming magic.
RemovedMagicAutoloadSniff
Detect declaration of the magic `__autoload()` method.
RemovedNamespacedAssertSniff
Detect declaration of a namespaced function called `assert()`.
RemovedPHP4StyleConstructorsSniff
Detect declarations of PHP 4 style constructors which are deprecated as of PHP 7.0.0.
ReservedFunctionNamesSniff
All function and method names starting with double underscore are reserved by PHP.
ArgumentFunctionsReportCurrentValueSniff
Functions inspecting function arguments report the current parameter value instead of the original since PHP 7.0.
ArgumentFunctionsUsageSniff
Detect usage of `func_get_args()`, `func_get_arg()` and `func_num_args()` in invalid context.
NewFunctionParametersSniff
Detect use of new function parameters in calls to native PHP functions.
NewFunctionsSniff
Detect calls to new native PHP functions.
OptionalToRequiredFunctionParametersSniff
Detect missing required function parameters in calls to native PHP functions.
RemovedFunctionParametersSniff
Detect use of deprecated/removed function parameters in calls to native PHP functions.
RemovedFunctionsSniff
Detect calls to deprecated/removed native PHP functions.
RequiredToOptionalFunctionParametersSniff
Detect missing required function parameters in calls to native PHP functions.
NewGeneratorReturnSniff
As of PHP 7.0, a `return` statement can be used within a generator for a final expression to be returned.
NewIniDirectivesSniff
Detect the use of new INI directives through `ini_set()` or `ini_get()`.
RemovedIniDirectivesSniff
Detect the use of deprecated and removed INI directives through `ini_set()` or `ini_get()`.
NewConstantArraysUsingConstSniff
Detect declaration of constants using the `const` keyword with a (constant) array value as supported since PHP 5.6.
NewConstantArraysUsingDefineSniff
Detect declaration of constants using `define()` with a (constant) array value as supported since PHP 7.0.
NewConstantScalarExpressionsSniff
Detect constant scalar expressions being used to set an initial value.
NewHeredocSniff
Detect a heredoc being used to set an initial value.
InternalInterfacesSniff
Detect classes which implement PHP native interfaces intended only for PHP internal use.
NewInterfacesSniff
Detect use of new PHP native interfaces and unsupported interface methods.
CaseSensitiveKeywordsSniff
Detect usage of `self`, `parent` and `static` and verify they are lowercase.
ForbiddenNamesAsDeclaredSniff
Detects the use of some reserved keywords to name a class, interface, trait or namespace.
ForbiddenNamesAsInvokedFunctionsSniff
Prohibits the use of reserved keywords invoked as functions.
ForbiddenNamesSniff
Detects the use of reserved keywords as class, function, namespace or constant names.
NewKeywordsSniff
Detect use of new PHP keywords.
NewEmptyNonVariableSniff
Verify that nothing but variables are passed to empty().
NewLanguageConstructsSniff
Detect use of new PHP language constructs.
AssignmentOrderSniff
Detect code affected by the changed list assignment order in PHP 7.0+.
ForbiddenEmptyListAssignmentSniff
Support for empty `list()` expressions has been removed in PHP 7.0.
NewKeyedListSniff
Since PHP 7.1, you can specify keys in `list()`, or its new shorthand `[]` syntax.
NewListReferenceAssignmentSniff
Detect reference assignments in array destructuring using (short) list.
NewShortListSniff
Detect short list syntax for symmetric array destructuring.
ForbiddenToStringParametersSniff
As of PHP 5.3, the `__toString()` magic method can no longer be passed arguments.
NewDirectCallsToCloneSniff
Detect direct calls to the `__clone()` magic method, which is allowed since PHP 7.0.
NewPHPOpenTagEOFSniff
PHP 7.4 now supports stand-alone PHP tags at the end of a file (without new line).
RemovedAlternativePHPTagsSniff
Check for use of alternative PHP tags, support for which was removed in PHP 7.0.
ValidIntegersSniff
Check for valid integer types and values.
ChangedConcatOperatorPrecedenceSniff
Detect code affected by the change in operator precedence of concatenation in PHP 8.0.
ForbiddenNegativeBitshiftSniff
Bitwise shifts by negative number will throw an ArithmeticError since PHP 7.0.
NewOperatorsSniff
Detect use of new PHP operators.
NewShortTernarySniff
Detect usage of the short ternary (elvis) operator as introduced in PHP 5.3.
RemovedTernaryAssociativitySniff
The left-associativity of the ternary operator is deprecated in PHP 7.4 and removed in PHP 8.0.
ForbiddenGetClassNullSniff
Detect: Passing `null` to `get_class()` is no longer allowed as of PHP 7.2.
ForbiddenStripTagsSelfClosingXHTMLSniff
Since PHP 5.3.4, `strip_tags()` ignores self-closing XHTML tags in allowable_tags
NewArrayReduceInitialTypeSniff
In PHP 5.2 and lower, the `$initial` parameter for `array_reduce()` had to be an integer.
NewFopenModesSniff
Check for valid values for the `fopen()` `$mode` parameter.
NewHashAlgorithmsSniff
Detect the use of newly introduced hash algorithms.
NewHTMLEntitiesEncodingDefaultSniff
As of PHP 5.4, the default character set for `htmlspecialchars()`, `htmlentities()` and `html_entity_decode()` is now `UTF-8`, instead of `ISO-8859-1`.
NewIconvMbstringCharsetDefaultSniff
Detect calls to Iconv and Mbstring functions with the optional `$charset`/`$encoding` parameter not set.
NewIDNVariantDefaultSniff
The default value for the `$variant` parameter has changed from `INTL_IDNA_VARIANT_2003` to `INTL_IDNA_VARIANT_UTS46` in PHP 7.4.
NewNegativeStringOffsetSniff
Detect negative string offsets as parameters passed to functions where this was not allowed prior to PHP 7.1.
NewPackFormatSniff
Check for valid values for the `$format` passed to `pack()`.
NewPasswordAlgoConstantValuesSniff
The constant value of the password hash algorithm constants has changed in PHP 7.4.
NewPCREModifiersSniff
Check for the use of newly added regex modifiers for PCRE functions.
NewProcOpenCmdArraySniff
As of PHP 7.4, `proc_open()` now also accepts an array instead of a string for the command.
NewStripTagsAllowableTagsArraySniff
As of PHP 7.4, `strip_tags()` now also accepts an array of `$allowable_tags`.
RemovedHashAlgorithmsSniff
Detect the use of deprecated and removed hash algorithms.
RemovedIconvEncodingSniff
Detect passing deprecated `$type` values to `iconv_get_encoding()`.
RemovedImplodeFlexibleParamOrderSniff
Passing the `$glue` and `$pieces` parameters to `implode()` in reverse order has been deprecated in PHP 7.4.
RemovedMbstringModifiersSniff
Check for use of deprecated and removed regex modifiers for MbString regex functions.
RemovedMbStrrposEncodingThirdParamSniff
Detect passing `$encoding` to `mb_strrpos()` as 3rd argument.
RemovedNonCryptoHashSniff
Detect usage of non-cryptographic hashes.
RemovedPCREModifiersSniff
Check for the use of deprecated and removed regex modifiers for PCRE regex functions.
RemovedSetlocaleStringSniff
Detect passing a string literal as `$category` to `setlocale()`.
ForbiddenCallTimePassByReferenceSniff
Detect the use of call time pass by reference.
NewArrayStringDereferencingSniff
Detect array and string literal dereferencing.
NewArrayUnpackingSniff
Using the spread operator for unpacking arrays in array expressions is available since PHP 7.4.
NewClassMemberAccessSniff
Detect class member access on object instantiation/cloning.
NewDynamicAccessToStaticSniff
Detect dynamic access to static methods and properties, as well as class constants.
NewFlexibleHeredocNowdocSniff
Detect usage of flexible heredoc/nowdoc and related cross-version incompatibilities.
NewFunctionArrayDereferencingSniff
Detect function array dereferencing as introduced in PHP 5.4.
NewFunctionCallTrailingCommaSniff
Detect trailing comma's in function calls, `isset()` and `unset()` as allowed since PHP 7.3.
NewShortArraySniff
Detect use of short array syntax which is available since PHP 5.4.
RemovedCurlyBraceArrayAccessSniff
Using the curly brace syntax to access array or string offsets has been deprecated in PHP 7.4.
RemovedNewReferenceSniff
Detect the use of assigning the return value of `new` by reference.
NewUnicodeEscapeSequenceSniff
PHP 7.0 introduced a Unicode codepoint escape sequence.
NewTypeCastsSniff
Detect use of newly introduced type casts.
RemovedTypeCastsSniff
Detect use of deprecated/removed type casts.
LowPHPCSSniff
Add a notification for users of low PHPCS versions.
LowPHPSniff
Add a notification for users of low PHP versions.
NewGroupUseDeclarationsSniff
Detect group use declarations as introduced in PHP 7.0.
NewUseConstFunctionSniff
Detect importing constants and functions via a `use` statement.
ForbiddenGlobalVariableVariableSniff
Detect use of `global` with variable variables, support for which has been removed in PHP 7.0.
ForbiddenThisUseContextsSniff
Detect using `$this` in incompatible contexts.
NewUniformVariableSyntaxSniff
The interpretation of variable variables has changed in PHP 7.0.
RemovedPredefinedGlobalVariablesSniff
Detect the use of removed global variables. Suggests alternatives if available.

Constants

PHP_CODESNIFFER_CBF  = \false
PHP_CODESNIFFER_IN_TESTS  = \true
PHP_CODESNIFFER_VERBOSITY  = 0
PHPCOMPATIBILITY_PHPCS_ALIASES_SET  = \true

Constants

PHPCOMPATIBILITY_PHPCS_ALIASES_SET

public mixed PHPCOMPATIBILITY_PHPCS_ALIASES_SET = \true

        
On this page

Search results