shield icon indicating copy to clipboard operation
shield copied to clipboard

Bug: Auth.php Errors

Open InsiteFX opened this issue 7 months ago • 6 comments

PHP Version

8.4.9

CodeIgniter4 Version

4.6.1

Shield Version

1.1.0

Which operating systems have you tested for this bug?

Windows

Which server did you use?

apache

Database

MySQL 8.4.3

Did you customize Shield?

No Customizations base install.

// shield/src/Auth.php

The minute I open Auth.php the errors show up.

The 2 Result lines below are throwing errors in phpStorm newest version.

If I remark them out like this they go away, it seems to be throwing the errors because of the email?: and all others with the ? mark in them

 //           | Errors
 // * @method //Result    attempt(array{email?: string, username?: string, password?: string, token?: string} $credentials)
 // * @method //Result    check(array{email?: string, username?: string, password?: string, token?: string} $credentials)

/**
 * Facade for Authentication
 *
 * @method Result    attempt(array{email?: string, username?: string, password?: string, token?: string} $credentials)
 * @method Result    check(array{email?: string, username?: string, password?: string, token?: string} $credentials)
 * @method bool      checkAction(string $token, string $type)                                                          [Session]
 * @method void      forget(?User $user = null)                                                                        [Session]
 * @method User|null getUser()
 * @method bool      loggedIn()
 * @method bool      login(User $user)
 * @method void      loginById($userId)
 * @method bool      logout()
 * @method void      recordActiveDate()
 * @method $this     remember(bool $shouldRemember = true)                                                             [Session]
 */
class Auth
{}

What happened?

Errors

Steps to Reproduce

Base install of shield

Expected Output

No Errors

Anything else?

No response

InsiteFX avatar Jul 06 '25 04:07 InsiteFX

I'm not using phpstorm. Can you show what are the errors thrown?

paulbalandan avatar Jul 06 '25 05:07 paulbalandan

Most likely the same as these:

Image Image Image

michalsn avatar Jul 06 '25 07:07 michalsn

The two top result one's both throw the error.

michalsn is showing them the 2 top facade result one's.

InsiteFX avatar Jul 06 '25 11:07 InsiteFX

It's the 2 top facade result ones, look at the varablies with the ?: in them there red on the varables.

Image

InsiteFX avatar Jul 06 '25 11:07 InsiteFX

If it help's it did it under php 8.7.4 also I just did not have the time to track it down then.

InsiteFX avatar Jul 06 '25 11:07 InsiteFX

Here is a better image showing were all the errors are.

Image

InsiteFX avatar Jul 06 '25 11:07 InsiteFX