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

[11.x] Fix the edge case of .php extension chopping in make commands #51909

Closed
wants to merge 2 commits into from

Conversation

osbre
Copy link
Contributor

@osbre osbre commented Jun 26, 2024

As pointed by @jasonmccreary in this comment: #51843 (comment)

Update: dependent on #51924

@timacdonald
Copy link
Member

This is not the same functionality as the origin is also problematic.

rtrim will trim characters, not the given string as a whole.

php artisan make:model Foo.php

// Foo

php artisan make:model Sponsorship

// Sponsorshi

php artisan make:model Photograph

// Photogra

@osbre osbre marked this pull request as draft June 26, 2024 01:03
@osbre
Copy link
Contributor Author

osbre commented Jun 26, 2024

Good catch. Seems like a good case for introducing Str::chop 😅 will send a PR shortly

@timacdonald
Copy link
Member

@osbre, I have just created a PR to fix the make command and introduce a helper function for this type of string manipulation.

@timacdonald
Copy link
Member

#51910

@osbre
Copy link
Contributor Author

osbre commented Jun 26, 2024

@timacdonald Good job! That was fast lol. I was just deciding between chop and chopEnd and you've already done it 😂

@osbre osbre reopened this Jun 27, 2024
@osbre osbre marked this pull request as ready for review June 27, 2024 01:09
@osbre osbre closed this Jun 27, 2024
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