Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[12.x] Remove redundant string casts from config files #55826

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

Closed
wants to merge 1 commit into from

Conversation

AhmedAlaa4611
Copy link
Contributor

Description

This PR removes unnecessary string casts from calls to the env() helper in Laravel's configuration files.

The env() function already returns string values by default for the following, so explicit string casting is redundant.

dump(gettype(env('APP_NAME', 'laravel')));  // "string"
dump(gettype(env('APP_URL', 'http://localhost')));  // "string"
dump(gettype(env('LOG_STACK', 'single')));  // "string"
dump(gettype(env('APP_PREVIOUS_KEYS', '')));  // "string"

These casts may also give the misleading impression that env() might return non-string values in cases where it does not, potentially confusing developers about the function's behavior. Removing these casts improves code clarity.

Reverts: #55737

@AhmedAlaa4611
Copy link
Contributor Author

@taylorotwell Would love to hear your thoughts about that.

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.

2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.