Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Phpcs Variable Analysis Laravel Package

sirbrillig/phpcs-variable-analysis

PHPCS plugin that analyzes variable usage: warns on undefined variables (including in unset), unused variables, and use of $this/self/static outside class scope. Works with PHPCS 3.13.5+ and PHP 5.4+.

View on GitHub
Deep Wiki
Context7
v3.0.0-beta.10
  • Restore version and dependabot updates from 2.x branch (711a32cf11eb92b7299d83ac7bc5eb1dba870450)

Full Changelog: https://github.com/sirbrillig/phpcs-variable-analysis/compare/v3.0.0-beta.9...v3.0.0-beta.10

v3.0.0-beta.9

What's Changed

This is preparing for a major 3.0 release which adds a dependency on PHPCSUtils. The new version should have the same functionality, fix some subtle bugs, and increase performance by over 2x.

Dependencies

  • Add phpcsutils as a dependency
  • Bump minimum phpcs version from 3.5.7 to 3.13.5 (8683965)

Refactoring (using phpcsutils)

  • Simplify getUseIndexForUseImport using findContainingOpeningBracket() (948d77f)
  • Replace findFunctionCallArguments custom loop with PassedParameters::getParameters() (3a0b6e4)
  • Replace isConstructorPromotion manual scan with FunctionDeclarations::getParameters() (5b97e89)
  • Replace areAnyConditionsAClass manual loop with Conditions::hasCondition() (f4ac147)
  • Simplify getListAssignments using Lists::getAssignments (75768da)
  • Replace findContainingOpeningBracket with phpcsutils equivalent (6b1bdda)
  • Replace isVariableInsideUnset/isVariableInsideIssetOrEmpty with phpcsutils equivalents (6a30e89)
  • Simplify arrow function detection by relying on T_FN (9da451f)
  • Remove unnecessary isArrowFunction block in getScopeCloseForScopeOpen (4cc7f35)

Full Changelog: https://github.com/sirbrillig/phpcs-variable-analysis/compare/v2.13.0...v3.0.0-beta.9

v2.12.0
v2.11.22
v2.11.20

What's Changed

Minor Changes

Full Changelog: https://github.com/sirbrillig/phpcs-variable-analysis/compare/v2.11.19...v2.11.20

v2.11.19

What's Changed

New Contributors

Full Changelog: https://github.com/sirbrillig/phpcs-variable-analysis/compare/v2.11.18...v2.11.19

v2.11.18

What's Changed

Full Changelog: https://github.com/sirbrillig/phpcs-variable-analysis/compare/v2.11.17...v2.11.18

v2.11.18-beta.2

Changelog

v2.11.18-beta.1

This release is going out as a beta first because I am traveling and if I break something I won't be around to fix it for a while, but it probably will be fine.

Changelog

  • Make sure that recursive search of list assignments stays inside them (#318)
  • A bunch of package updates that shouldn't affect things.
v2.11.17

Changelog

  • Do not close scope of ref reassignment when inside else (#306)
v2.11.16

Changelog

Arrow function scope just keeps going.

  • Allow newlines in arrow functions (#301)
v2.11.15

Changelog

  • Fix scope closer detection in arrow function detection (#298)
v2.11.14

Changelog

  • Use custom logic for finding arrow function scope (#296)
v2.11.13

Changelog

  • Support readonly constructor promotion (#294).
v2.11.12

Changelog

  • Allow non-enum tokens called 'enum' (#293)
v2.11.11

Changelog

  • Add support for enum methods (#289)
v2.11.10

Changelog

  • Composer: allow for the 1.0.0 version of the Composer PHPCS plugin (#287)
v2.11.9

Changelog

  • Prevent detecting static closures when looking for static variables (#281)
v2.11.8

Changelog

  • Fix function call detection to exclude non-function tokens (#279)
v2.11.7

Changelog

Another bug fix for a static variable regression caused by https://github.com/sirbrillig/phpcs-variable-analysis/pull/267.

  • Place static arrow function body outside of scope on static declaration check (#276) Props @arkener!
v2.11.6

Changelog

This is a bug fix release for two regressions caused by the new static function variable scanning added in #267.

  • Ignore function call arguments on static declarations processing (#273) props @arkener!
  • Fix scanning for static variables near start of file (#274)
v2.11.5

Changelog

  • Allow for loop increment expression to use variable defined inside loop (#262)
  • Support constructor promotion (#266)
  • Improve static declaration checks (#267)
  • Handle inline if list destructure (#268)
  • Remove php_errormsg from superglobals list (#269)
  • Ignore unused parameters when function in abstract class is empty (#270)
v2.11.4

Changelog

Mostly a bunch of housekeeping changes internal to the codebase, but this does include a fix for a deprecation notice in PHP 8.2.

v2.11.3

Changelog

  • Update for Composer 2.2 (#242)
v2.11.2

Changelog

  • Respect ignoring undefined variables in else blocks (#239)
v2.11.1

Changelog

  • Allow parsing mixed HTML and PHP (#234 and #236)
  • Ignore double assignment by reference if second is inside condition (#235)
v2.11.0

Changelog

  • Start inline block scope at end of condition rather than at keyword (#230)
  • Add allowUnusedVariablesInFileScope option (#229)
v2.10.3-beta.1

Changelog

  • Start inline block scope at end of condition rather than at keyword (#230)
  • Add allowUnusedVariablesInFileScope option (#229)
v2.10.2

Changelog

  • Treat writing to a by-reference foreach loop variable as a read (#221) (props to @MPParsley for finding this bug!)
  • Properly detect variables used in quotes inside arrow functions (#222) (props to @ocean90 for finding this bug!)
v2.10.2-beta.1

Changelog

  • Treat writing to a by-reference foreach loop variable as a read (#221) (props to @MPParsley for finding this bug!)
  • Properly detect variables used in quotes inside arrow functions (#222) (props to @ocean90 for finding this bug!)
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope
anil/file-picker
broqit/fields-ai