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

Return signatures of Autoloader's loaders should be void #7747

Merged
merged 1 commit into from
Aug 2, 2023

Conversation

paulbalandan
Copy link
Member

Description
Ref: https://www.php.net/manual/en/function.spl-autoload-register.php

As a result of this change, this may be a potential BC break. I added this to the changelog. Also marked @internal those 2 callbacks.

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@paulbalandan paulbalandan added bug Verified issues on the current code behavior or pull requests that will fix them breaking change Pull requests that may break existing functionalities labels Jul 29, 2023
system/Autoloader/Autoloader.php Outdated Show resolved Hide resolved
system/Autoloader/Autoloader.php Outdated Show resolved Hide resolved
system/Autoloader/Autoloader.php Outdated Show resolved Hide resolved
@kenjis
Copy link
Member

kenjis commented Jul 29, 2023

@paulbalandan I don't see the benefit. I don't think this is a bug.
Returning a value does not cause errors. I don't see that the callback return type must be void in PHP manual.
If you really want to change it, it is better to send to 4.4.

I think adding @internal is okay.

@kenjis kenjis added the stale Pull requests with conflicts label Jul 29, 2023
@paulbalandan
Copy link
Member Author

The signature is in the Parameters section:

callback
The autoload function being registered. If null, then the default implementation of spl_autoload() will be registered.

callback(string $class): void
The class will not contain the leading backslash of a fully-qualified identifier.

Okay, I'll send to 4.4

@paulbalandan paulbalandan changed the base branch from develop to 4.4 July 30, 2023 11:35
@paulbalandan paulbalandan changed the title fix: return signatures of Autoloader's loaders should be void Return signatures of Autoloader's loaders should be void Jul 30, 2023
@paulbalandan paulbalandan removed bug Verified issues on the current code behavior or pull requests that will fix them stale Pull requests with conflicts labels Jul 30, 2023
@kenjis
Copy link
Member

kenjis commented Jul 31, 2023

@paulbalandan Okay, the callback return type should be void.

@kenjis kenjis added 4.4 bug Verified issues on the current code behavior or pull requests that will fix them stale Pull requests with conflicts labels Jul 31, 2023
@kenjis kenjis removed the stale Pull requests with conflicts label Aug 2, 2023
@paulbalandan paulbalandan merged commit fdd935d into codeigniter4:4.4 Aug 2, 2023
51 checks passed
@paulbalandan paulbalandan deleted the autoloader-loader branch August 2, 2023 02:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.4 breaking change Pull requests that may break existing functionalities bug Verified issues on the current code behavior or pull requests that will fix them
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants