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

[10.x] Fix model:prune command error with non-class php files #48708

Merged
merged 1 commit into from
Oct 11, 2023

Conversation

zlodes
Copy link
Contributor

@zlodes zlodes commented Oct 11, 2023

It's advisable to first verify if the PHP file contains a class. If not, the isPrunable check will fail as it utilizes the class_uses_recursive function.

Also Prunable trait uses Eloquent methods (like delete). It would be better to check that a class is a Model before checking for used traits (class_uses_recursive).

@zlodes zlodes changed the title [10.x] Fix model:prune error with non-class php files [10.x] Fix model:prune command error with non-class php files Oct 11, 2023
@taylorotwell taylorotwell merged commit 7966308 into laravel:10.x Oct 11, 2023
20 checks passed
timacdonald pushed a commit to timacdonald/framework that referenced this pull request Oct 24, 2023
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