Skip to content

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

coveralls commented Apr 30, 2025

Coverage Status

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

@olvlvl
Copy link
Member

olvlvl commented May 26, 2025

Thank you! That's a great catch. I should have removed require __DIR__ . '/../lib/helpers.php'; from the test bootstrap. Let's remove the bootstrap altogether now.

I've updated the Ubuntu version in another commit. Could you rebase your branch?

@olvlvl olvlvl mentioned this pull request May 26, 2025
@olvlvl
Copy link
Member

olvlvl commented May 26, 2025

I opened a PR #45

@donatj donatj force-pushed the fix/user-statics-internally branch from 41e1983 to c6e5ea6 Compare May 26, 2025 14:09
@donatj
Copy link
Contributor Author

donatj commented May 26, 2025

Ok, I rebased my branch ;)

One note - I'd had used ubuntu-latest, I see you're using ubuntu-22.04 -

It's personal preference of course, but in my own repos I trust Ubuntu to continue working across stable releases more than I trust myself to remember to update all of my GitHub Actions every time GitHub deprecates a release.

Anyway, thanks for the project! I've been using it for years!

@olvlvl olvlvl merged commit 7d8485f into ICanBoogie:main May 26, 2025
6 checks passed
@olvlvl
Copy link
Member

olvlvl commented May 26, 2025

@donatj Thank you for your contribution. I published v3.0.1 with our changes.

@olvlvl olvlvl added the bug label May 26, 2025
@olvlvl olvlvl added this to the v3.0.1 milestone May 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants