Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Bug: Auth.php Errors

Đang mở
#1,270 6 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
php
Lĩnh vực
authentication

Hướng nghiên cứu

Bắt đầu với shield/src/Auth.php và kiểm tra các chẩn đoán của PhpStorm đối với các chú thích @method của attempt() và check(), bằng cách sử dụng một bản cài đặt Shield cơ bản với các phiên bản PHP, CodeIgniter và Shield đã được báo cáo. Tái hiện các lỗi đã báo cáo và xác định hành vi chú thích được mong đợi; được xem là hoàn tất khi các lỗi được ghi lại đã được giải quyết mà không xóa các khai báo phương thức.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug
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

Ngôn ngữ chính
PHP
Star
426
Fork
144
Merge trung bình
3 ngày 14 giờ
Pull request đã merge (30 ngày)
2

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của codeigniter4/shield

Tất cả issue của codeigniter4/shield

Issue tương tự

Thêm issue về PHP

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.