Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update view "version" variable name to avoid potential conflicts #1563

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pb30
Copy link

@pb30 pb30 commented Jun 20, 2024

Summary

We inherited a number of projects that have a global version variable shared with all views that is an array of things like asset versions, etc.

When running php artisan ide-helper:generate it results in an error since $version is used in this packages views.

Array to string conversion at vendor/barryvdh/laravel-ide-helper/resources/views/helper.php:17

This PR renames the variable to $laravel_version to avoid conflicts since it may be a common global variable name.

Type of change

  • Misc. change (internal, infrastructure, maintenance, etc.)

Checklist

  • Existing tests have been adapted and/or new tests have been added
  • Add a CHANGELOG.md entry
  • Update the README.md
  • Code style has been fixed via composer fix-style

Copy link
Collaborator

@mfn mfn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

I don't understand how the conflict happens, but I don't mind the change.

If there can be pollution/conflict, it would probably be best to prefix all the vars with $ide_helper_* or so.

@barryvdh
Copy link
Owner

Hmm I think it's a bit odd that we need to account for all possible variables. If someone (slight chance) has overriden the template, this would be considered BC break.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants