Skip to content

Replace internal calls to helpers with StaticInflector #43

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

donatj
Copy link
Contributor

@donatj donatj commented Apr 30, 2025

So while you have this warning, the library itself currently leans on these helpers, so much of the does not work without requiring vendor/icanboogie/inflector/lib/helpers.php

Warning

Since v3.0 the file with the helper functions is no longer included in the
autoload.
You need to include the file vendor/icanboogie/inflector/lib/helpers.php
in your composer.json if you want to continue using these functions.

So for instance

<?php

require 'vendor/autoload.php';

use ICanBoogie\Inflector;

echo Inflector::get('en')->pluralize('soup');

currently throws

Fatal error: Uncaught Error: Call to undefined function ICanBoogie\upcase() in /Users/jdonat/Sites/myon/vendor/icanboogie/inflector/lib/Inflections.php on line 255

This PR just changes all the call sites where the helpers are being used internally to use the static inflector instead of helpers

@donatj
Copy link
Contributor Author

donatj commented Apr 30, 2025

I also swapped ubuntu-20.04 with ubuntu-latest in your CI tests, as ubuntu-20.04 is no longer supported by GitHub actions. I can pull this change out if you are so inclined.

@coveralls
Copy link

Coverage Status

coverage: 94.475%. remained the same
when pulling 41e1983 on donatj:fix/user-statics-internally
into efd39be on ICanBoogie:main.

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