false-positive: Call to static method PHPUnit\Framework\Assert::assertCount() with int<0, max> and array will always evaluate to true
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 68/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- php
- Lĩnh vực
- testing-qa
Hướng nghiên cứu
Start by reproducing the reported assertCount call with the supplied PHPDoc types using phpstan/phpstan 2.2.14 and phpstan/phpstan-phpunit 2.0.18. Trace the PHPUnit assertCount rule or entry point that reports the diagnostic, then add or update a regression test so this valid call is no longer reported as always true.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
With the method below phpstan since lately reports the false-positive "Call to static method PHPUnit\Framework\Assert::assertCount() with int<0, max> and array will always evaluate to true."
/**
* @param array<int|string> $expectedKeys
* @param array<mixed> $actual
*/
public static function assertArrayHasSameKeys(array $expectedKeys, array $actual): void {
\PHPUnit\Framework\Assert::assertCount(count($expectedKeys), $actual);
// ...
}
Used versions:
phpstan/phpstan 2.2.14
phpstan/phpstan-phpunit 2.0.18
- Ngôn ngữ chính
- PHP
- Star
- 544
- Fork
- 58
- Merge trung bình
- 2 ngày 1 giờ
- Pull request đã merge (30 ngày)
- 5
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của phpstan/phpstan-phpunit
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
phpstan/phpstan-phpunit#321 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
phpstan/phpstan-phpunit#309 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
phpstan/phpstan-phpunit#299 · 2 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 52/100
phpstan/phpstan-phpunit#292 · 3 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 20/100
phpstan/phpstan-phpunit#291 ·
Tất cả issue của phpstan/phpstan-phpunit
Issue tương tự
-
[Chore] Keep one viget-block-generator skill and replicate it, instead of four tracked copies Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
hector-jewell/food-delivery-system-for-restaurant-using-php#1311 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Sylius/SyliusGridBundle#501 ·