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

Added ability to load classes with _ in them #566

Merged
merged 1 commit into from
Mar 30, 2024
Merged

Added ability to load classes with _ in them #566

merged 1 commit into from
Mar 30, 2024

Conversation

n0nag0n
Copy link
Collaborator

@n0nag0n n0nag0n commented Mar 30, 2024

This allows you to load a class in your codebase such as Pascal_Snake_Case and it will still work. You must set it with Loader::setV2ClassLoading(false);

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This actually caused php8.1+ to fail because it thought the ReturnTypeWillChange class was an attribute class....so it failed.

$this->expectException(ErrorException::class);
$this->expectExceptionMessageMatches("/Passing null to parameter/");
// php 7.4 will throw a PDO exception, but php 8 will throw an ErrorException
if(version_compare(PHP_VERSION, '8.0.0', '<')) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is highly unusual, but the behavior in PDO actually changed inbetween 7.4 and 8.0 to throw different error messages.

@n0nag0n n0nag0n merged commit fe2ad0c into master Mar 30, 2024
@n0nag0n n0nag0n deleted the v2-loader branch March 30, 2024 13:37
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.

1 participant