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

Function with return type must return a value #25

Closed
MarcPinnell opened this issue Nov 26, 2024 · 1 comment
Closed

Function with return type must return a value #25

MarcPinnell opened this issue Nov 26, 2024 · 1 comment

Comments

@MarcPinnell
Copy link

Updating my ci4-auth install. Updated to CI 4.55 and found that the older ci4-auth was causing issues with site_URL(). so removed my src folder and dropped in the new one. Manually updated the tables to match the new structure. The login, logout and landing pages work great. But, if you try to go deeper into the site, ci4-auth throws an error:

Function with return type must return a value
PPATH/ThirdParty/lewe/ci4-auth/src/Filters/RoleFilter.php at line 31

27   public function before(RequestInterface $request, $arguments = null): \CodeIgniter\HTTP\RedirectResponse
28   {
29     if (!function_exists('logged_in')) helper('auth');
30 
31     if (empty($arguments)) return;

If I comment out the bit after the colon on line 27, the site works fine. Any suggestions as to what is going on? From what I read CI is expecting a return in the RedirectResponse type.

Thanks, love the module!

glewe added a commit that referenced this issue Nov 27, 2024
@glewe
Copy link
Owner

glewe commented Nov 27, 2024

Hi @MarcPinnell ,

true, the older release does not entirely follow strict coding rules. Newer PHP versions require those though. I started playing with PHP 8.4.1 and even CI 4.5.5 is not adjusted to 8.4 yet.

Anyway, I committed the updated filter classes just now. See if those work for you.

Best regards,
George

@glewe glewe closed this as completed Nov 27, 2024
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

2 participants