Skip to content

Tags: sirbrillig/phpcs-variable-analysis

Tags

v3.0.0

Toggle v3.0.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
GH Actions: fail "setup-php" if requested tooling could not be instal…

…led (#376)

Setup-PHP will normally "gracefully" show a warning and not fail the build when an extension or tool failed to install.

In most cases, this is not particularly useful as that means that either there will be a failure later on in the build due to the extension or tool missing, or the build will not be representative of what is supposed to be tested.

This commit changes this behaviour to fail select builds at the `setup-php` step, which also makes debugging these type of build failures much more straight-forward.

Ref: https://github.com/shivammathur/setup-php?tab=readme-ov-file#fail-fast-optional

Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>

v3.0.0-beta.10

Toggle v3.0.0-beta.10's commit message
Restore version and dependabot updates from 2.x branch

v3.0.0-beta.9

Toggle v3.0.0-beta.9's commit message
Simplify getUseIndexForUseImport using findContainingOpeningBracket()

Replaces the manual findPrevious call with an exclusion list with the
existing findContainingOpeningBracket() abstraction, and simplifies the
second findPrevious to skip only empty tokens.

v2.13.0

Toggle v2.13.0's commit message
Update README to mention 3.5.7 is new min version of phpcs

v2.12.0

Toggle v2.12.0's commit message

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

Toggle v2.11.22's commit message

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

Toggle v2.11.21's commit message

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

Toggle v2.11.20's commit message

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

Toggle v2.11.19's commit message

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

Toggle v2.11.18's commit message

Verified

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