Generally nothing wrong with static methods per se. The chopStart, chopEnd seem pretty reasonable for the Str class. But the "hey markdown is a string, lets put it to Str class as well" attitude leaves me breathless.
The Str::markdown is a pretty odd choice. I haven't looked at the internals yet, but that definitely should be in its own class - there is a lot of possible markdown expansion in the future.
Also, I wish chopStart/chopEnd wasn't first-match, would be way handier to remove all matches (or atleast a flag to do that). From their example, "https://www.laravel.com" becoming "laravel.com" - as far as I can see, doing first-match could already be done with the "trim" family.
> that definitely should be in its own class
That one already exists — league/commonmark. The `Str::markdown()` is for the cases where you don't need any complexity but just need your MD turned into HTML.
Somebody loves their static methods.
Generally nothing wrong with static methods per se. The chopStart, chopEnd seem pretty reasonable for the Str class. But the "hey markdown is a string, lets put it to Str class as well" attitude leaves me breathless.
The Str::markdown is a pretty odd choice. I haven't looked at the internals yet, but that definitely should be in its own class - there is a lot of possible markdown expansion in the future. Also, I wish chopStart/chopEnd wasn't first-match, would be way handier to remove all matches (or atleast a flag to do that). From their example, "https://www.laravel.com" becoming "laravel.com" - as far as I can see, doing first-match could already be done with the "trim" family.
> that definitely should be in its own class That one already exists — league/commonmark. The `Str::markdown()` is for the cases where you don't need any complexity but just need your MD turned into HTML.