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

pascal case "__toString" is converted to sentence case "Tostring" instead of "To string" #84

Open
khalyomede opened this issue Sep 3, 2022 · 0 comments

Comments

@khalyomede
Copy link

khalyomede commented Sep 3, 2022

The following reproduction code will show the issue:

use Jawira\CaseConverter\Convert;

require __DIR__ . "/vendor/autoload.php";

$original = "__toString";
$text = new Convert($original);
$expected = "To string";
$sentence = $text->toSentence();

echo $expected === $sentence
    ? "$expected === $sentence" . PHP_EOL
    : "Expected $sentence to be $expected";

echo PHP_EOL;
Expected Tostring to be To string

Is it expected?

FYI here is how one NPM package handles it (as expected in my opinion)

Capture d’écran du 2022-09-03 18-07-13

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

No branches or pull requests

1 participant