Tags: sirbrillig/phpcs-variable-analysis
Tags
Accept namespaces in sitePassByRefFunctions (#351) * Add test for using a namespace in sitePassByRefFunctions * Add namespace to function names when looking for pass-by-reference * Make sure cache is not used before it is ready * Make sure we don't try to use null in getPassByReferenceFunction * Init passByRefFunctionsCache to null explicitly
Allow finding arrow function variables when arrow function is in file… … scope (#347) * Add test for arrow function in global scope * Still look for arrow func when var scope is 0 `findVariableScopeExceptArrowFunctions()` can return null if it finds no scope, but it can also return 0 which is the file level scope. The additional code to look for arrow function scope needs to operate even on 0. * Remove duplicate call to findVariableScopeExceptArrowFunctions * Remove phpcs-import-detection depdendency since it is unused * Remove ImportDetection on phpcs config
Handle compact inside arrow functions (#339) * Add test for compact used within arrow function * Process every variable in compact separately * Also track position of compact variables * Guard against missing compact variable position * Fix linting errors * Also add test for outside var
fix: Process variable before the end of scope (#324) * test: add test for variable use in short open echo When a variable is used in a short php open echo tag, it should be marked as used. * fix: process variable before the end of scope fixes #323 When the last php code is a short php open echo tag using a variable, process the variable before processing the end of scope.
Do not close scope of ref reassignment when inside else (#306) * Add test for unused variable * Add more debug lines to reference processing * Do not close scope of ref reassignment when inside else * Verify all regexps are non-empty strings This will please psalm, I hope. * Add guard for empty preg_match_all in processVariableInString
PreviousNext