Error when custom rules read files, but don't track them

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

Maintainer thường phản hồi trong vòng 1 ngày

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

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
34/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
php
Lĩnh vực
performance, tooling

Hướng nghiên cứu

No file or test is named in the payload. Begin by reading how PHPStan executes custom rules and where $scope->trackFileDependency($path) is exposed, then follow how rule results enter the cache and what invalidates them. The change should detect file_get_contents, fopen, parse_ini_file and similar calls in rule code and surface a suggestion to track the read path; done means such a rule produces that signal without false positives on unrelated calls.

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

Mô tả

feature-request
Feature request

when the implementation of a rule contains file_get_contents($path), fopen, parse_ini_file or similar file reading functions, this means the rules results depend on that external file.

I think we could take such a indicator to propose the use of $scope->trackFileDependency($path) with the goal to unlock best possible cache-invalidation. if PHPStan does not invalidate enough its usually a frustrating experience for the enduser.

Did PHPStan help you today? Did it make you happy in any way?

No response

Ngôn ngữ chính
PHP
Star
14.2k
Fork
972
Merge trung bình
13 giờ 25 phút
Pull request đã merge (30 ngày)
142

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

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

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 phpstan/phpstan

Tất cả issue của phpstan/phpstan

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.