Skip to content

Tags: sirbrillig/phpcs-variable-analysis

Tags

v2.12.0

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
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

v2.11.22

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
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

v2.11.21

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Only search for nested arrow functions if necessary (#342)

* Do not search for nested arrow func outside of arrow func

* Recursively search for containing arrow function

* Guard for no enclosing scope

v2.11.20

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
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

v2.11.19

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
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.

v2.11.18

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Fix nullable constructor promotion detection (#321)

v2.11.18-beta.2

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Fix nullable constructor promotion detection (#321)

v2.11.18-beta.1

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Make sure that recursive search of list assignments stays inside them (

…#318)

* Add tests for destructuring assignment with array arg

* Make sure that recursive search of list assignments stays inside them

v2.11.17

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
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

v2.11.16

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Allow newlines in arrow functions (#301)

* Add test for arrow func with newlines

* Allow newlines in arrow functions

* Add test for new class in arrow function

* Add some more arrow function tests