Conversation
WalkthroughBumped minimum PHP to 8.2 (docs, composer), removed PHP 8.1 from CI matrix, enabled PHP 8.2 sets/rules in Rector and PHP-CS-Fixer, updated phpunit config, and migrated PHPUnit docblock Changes
Sequence Diagram(s)Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: ASSERTIVE Plan: Pro 📒 Files selected for processing (2)
🧰 Additional context used🧬 Code graph analysis (2)tests/IsEmptyTest.php (2)
tests/IsNotEmptyTest.php (2)
🪛 PHPMD (2.15.0)tests/IsEmptyTest.php14-14: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsIfIterableIsEmpty'. (undefined) (StaticAccess) 15-15: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsIfIterableIsEmpty'. (undefined) (StaticAccess) 21-21: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsTrueForEmptyArrayWithMixedKeys'. (undefined) (StaticAccess) 27-27: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsFalseForArrayWithNullValue'. (undefined) (StaticAccess) 28-28: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsFalseForArrayWithNullValue'. (undefined) (StaticAccess) 43-43: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsFalseForArrayWithStringKeys'. (undefined) (StaticAccess) 44-44: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsFalseForArrayWithStringKeys'. (undefined) (StaticAccess) 50-50: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsFalseForArrayWithNumericKeys'. (undefined) (StaticAccess) 51-51: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsFalseForArrayWithNumericKeys'. (undefined) (StaticAccess) 78-78: Missing class import via use statement (line '78', column '33'). (undefined) (MissingImport) 79-79: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itHandlesEmptyArrayObject'. (undefined) (StaticAccess) 85-85: Missing class import via use statement (line '85', column '28'). (undefined) (MissingImport) 86-86: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itHandlesNonEmptyArrayObject'. (undefined) (StaticAccess) tests/IsNotEmptyTest.php14-14: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsIfIterableIsNotEmpty'. (undefined) (StaticAccess) 15-15: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsIfIterableIsNotEmpty'. (undefined) (StaticAccess) 21-21: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsFalseForEmptyArrayWithMixedKeys'. (undefined) (StaticAccess) 27-27: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsTrueForArrayWithNullValue'. (undefined) (StaticAccess) 28-28: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsTrueForArrayWithNullValue'. (undefined) (StaticAccess) 43-43: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsTrueForArrayWithStringKeys'. (undefined) (StaticAccess) 44-44: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsTrueForArrayWithStringKeys'. (undefined) (StaticAccess) 50-50: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsTrueForArrayWithNumericKeys'. (undefined) (StaticAccess) 51-51: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsTrueForArrayWithNumericKeys'. (undefined) (StaticAccess) 78-78: Missing class import via use statement (line '78', column '33'). (undefined) (MissingImport) 79-79: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itHandlesEmptyArrayObject'. (undefined) (StaticAccess) 85-85: Missing class import via use statement (line '85', column '28'). (undefined) (MissingImport) 86-86: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itHandlesNonEmptyArrayObject'. (undefined) (StaticAccess) 102-102: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itHandlesSingleElementIterables'. (undefined) (StaticAccess) 103-103: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itHandlesSingleElementIterables'. (undefined) (StaticAccess) 104-104: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itHandlesSingleElementIterables'. (undefined) (StaticAccess) 🔇 Additional comments (2)
Comment |
Pull Request Test Coverage Report for Build 18283281136Details
💛 - Coveralls |
There was a problem hiding this comment.
Actionable comments posted: 3
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (9)
.php-cs-fixer.php(1 hunks)phpunit.xml.dist(1 hunks)tests/FilterTest.php(13 hunks)tests/FirstTest.php(7 hunks)tests/IsEmptyTest.php(5 hunks)tests/IsNotEmptyTest.php(5 hunks)tests/KeysTest.php(8 hunks)tests/MapTest.php(11 hunks)tests/MapWithKeysTest.php(12 hunks)
🧰 Additional context used
🧬 Code graph analysis (7)
tests/IsEmptyTest.php (2)
tests/IsNotEmptyTest.php (13)
PHPUnit(11-16)PHPUnit(18-23)PHPUnit(25-30)PHPUnit(32-39)PHPUnit(41-46)PHPUnit(48-53)PHPUnit(55-64)PHPUnit(66-74)PHPUnit(76-81)PHPUnit(83-88)PHPUnit(90-98)PHPUnit(100-106)PHPUnit(108-114)src/Iterables.php (2)
Iterables(7-115)isEmpty(65-72)
tests/KeysTest.php (3)
tests/FilterTest.php (13)
PHPUnit(12-21)PHPUnit(23-32)PHPUnit(34-43)PHPUnit(45-54)PHPUnit(56-65)PHPUnit(67-76)PHPUnit(78-87)PHPUnit(89-98)PHPUnit(100-109)PHPUnit(111-120)PHPUnit(122-131)PHPUnit(133-148)PHPUnit(150-161)tests/FirstTest.php (3)
PHPUnit(11-18)PHPUnit(20-24)PHPUnit(26-32)src/Iterables.php (2)
keys(91-96)Iterables(7-115)
tests/IsNotEmptyTest.php (2)
tests/IsEmptyTest.php (12)
PHPUnit(11-16)PHPUnit(18-23)PHPUnit(25-30)PHPUnit(32-39)PHPUnit(41-46)PHPUnit(48-53)PHPUnit(55-64)PHPUnit(66-74)PHPUnit(76-81)PHPUnit(83-88)PHPUnit(90-98)PHPUnit(100-106)src/Iterables.php (2)
Iterables(7-115)isNotEmpty(79-82)
tests/FirstTest.php (2)
tests/FilterTest.php (13)
PHPUnit(12-21)PHPUnit(23-32)PHPUnit(34-43)PHPUnit(45-54)PHPUnit(56-65)PHPUnit(67-76)PHPUnit(78-87)PHPUnit(89-98)PHPUnit(100-109)PHPUnit(111-120)PHPUnit(122-131)PHPUnit(133-148)PHPUnit(150-161)src/Iterables.php (2)
Iterables(7-115)first(51-58)
tests/MapWithKeysTest.php (2)
tests/FilterTest.php (13)
PHPUnit(12-21)PHPUnit(23-32)PHPUnit(34-43)PHPUnit(45-54)PHPUnit(56-65)PHPUnit(67-76)PHPUnit(78-87)PHPUnit(89-98)PHPUnit(100-109)PHPUnit(111-120)PHPUnit(122-131)PHPUnit(133-148)PHPUnit(150-161)tests/FirstTest.php (3)
PHPUnit(11-18)PHPUnit(20-24)PHPUnit(26-32)
tests/MapTest.php (2)
tests/FilterTest.php (13)
PHPUnit(12-21)PHPUnit(23-32)PHPUnit(34-43)PHPUnit(45-54)PHPUnit(56-65)PHPUnit(67-76)PHPUnit(78-87)PHPUnit(89-98)PHPUnit(100-109)PHPUnit(111-120)PHPUnit(122-131)PHPUnit(133-148)PHPUnit(150-161)tests/FirstTest.php (3)
PHPUnit(11-18)PHPUnit(20-24)PHPUnit(26-32)
tests/FilterTest.php (2)
tests/FirstTest.php (13)
PHPUnit(11-18)PHPUnit(20-24)PHPUnit(26-32)PHPUnit(34-39)PHPUnit(41-48)PHPUnit(50-55)PHPUnit(57-62)PHPUnit(64-74)PHPUnit(76-85)PHPUnit(87-95)PHPUnit(97-105)PHPUnit(107-113)PHPUnit(115-121)tests/TestCase.php (1)
TestCase(7-9)
🪛 PHPMD (2.15.0)
tests/IsEmptyTest.php
14-14: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsIfIterableIsEmpty'. (undefined)
(StaticAccess)
15-15: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsIfIterableIsEmpty'. (undefined)
(StaticAccess)
21-21: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsTrueForEmptyArrayWithMixedKeys'. (undefined)
(StaticAccess)
22-22: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsTrueForEmptyArrayWithMixedKeys'. (undefined)
(StaticAccess)
28-28: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsFalseForArrayWithNullValue'. (undefined)
(StaticAccess)
29-29: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsFalseForArrayWithNullValue'. (undefined)
(StaticAccess)
44-44: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsFalseForArrayWithStringKeys'. (undefined)
(StaticAccess)
45-45: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsFalseForArrayWithStringKeys'. (undefined)
(StaticAccess)
51-51: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsFalseForArrayWithNumericKeys'. (undefined)
(StaticAccess)
52-52: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsFalseForArrayWithNumericKeys'. (undefined)
(StaticAccess)
79-79: Missing class import via use statement (line '79', column '33'). (undefined)
(MissingImport)
80-80: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itHandlesEmptyArrayObject'. (undefined)
(StaticAccess)
86-86: Missing class import via use statement (line '86', column '28'). (undefined)
(MissingImport)
87-87: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itHandlesNonEmptyArrayObject'. (undefined)
(StaticAccess)
tests/KeysTest.php
25-25: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsEmptyArrayForEmptyIterable'. (undefined)
(StaticAccess)
52-52: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsNegativeNumericKeys'. (undefined)
(StaticAccess)
59-59: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsStringKeys'. (undefined)
(StaticAccess)
66-66: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsEmptyStringKey'. (undefined)
(StaticAccess)
73-73: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsMixedKeyTypes'. (undefined)
(StaticAccess)
80-80: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsKeysWithNullValues'. (undefined)
(StaticAccess)
126-126: Missing class import via use statement (line '126', column '28'). (undefined)
(MissingImport)
127-127: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsKeysFromArrayObject'. (undefined)
(StaticAccess)
134-134: Missing class import via use statement (line '134', column '33'). (undefined)
(MissingImport)
135-135: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsEmptyForEmptyArrayObject'. (undefined)
(StaticAccess)
142-142: Missing class import via use statement (line '142', column '25'). (undefined)
(MissingImport)
143-143: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsKeysFromArrayIterator'. (undefined)
(StaticAccess)
tests/IsNotEmptyTest.php
14-14: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsIfIterableIsNotEmpty'. (undefined)
(StaticAccess)
15-15: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsIfIterableIsNotEmpty'. (undefined)
(StaticAccess)
21-21: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsFalseForEmptyArrayWithMixedKeys'. (undefined)
(StaticAccess)
22-22: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsFalseForEmptyArrayWithMixedKeys'. (undefined)
(StaticAccess)
28-28: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsTrueForArrayWithNullValue'. (undefined)
(StaticAccess)
29-29: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsTrueForArrayWithNullValue'. (undefined)
(StaticAccess)
44-44: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsTrueForArrayWithStringKeys'. (undefined)
(StaticAccess)
45-45: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsTrueForArrayWithStringKeys'. (undefined)
(StaticAccess)
51-51: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsTrueForArrayWithNumericKeys'. (undefined)
(StaticAccess)
52-52: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsTrueForArrayWithNumericKeys'. (undefined)
(StaticAccess)
79-79: Missing class import via use statement (line '79', column '33'). (undefined)
(MissingImport)
80-80: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itHandlesEmptyArrayObject'. (undefined)
(StaticAccess)
86-86: Missing class import via use statement (line '86', column '28'). (undefined)
(MissingImport)
87-87: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itHandlesNonEmptyArrayObject'. (undefined)
(StaticAccess)
103-103: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itHandlesSingleElementIterables'. (undefined)
(StaticAccess)
104-104: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itHandlesSingleElementIterables'. (undefined)
(StaticAccess)
105-105: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itHandlesSingleElementIterables'. (undefined)
(StaticAccess)
tests/FirstTest.php
23-23: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsNullIfIterableIsEmptyWhileGettingFirstValue'. (undefined)
(StaticAccess)
29-29: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsFirstValueFromSingleElementIterable'. (undefined)
(StaticAccess)
30-30: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsFirstValueFromSingleElementIterable'. (undefined)
(StaticAccess)
31-31: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsFirstValueFromSingleElementIterable'. (undefined)
(StaticAccess)
37-37: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsNullAsFirstValue'. (undefined)
(StaticAccess)
38-38: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsNullAsFirstValue'. (undefined)
(StaticAccess)
53-53: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsFirstValueWithStringKeys'. (undefined)
(StaticAccess)
54-54: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsFirstValueWithStringKeys'. (undefined)
(StaticAccess)
60-60: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsFirstValueWithNumericKeys'. (undefined)
(StaticAccess)
61-61: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsFirstValueWithNumericKeys'. (undefined)
(StaticAccess)
110-110: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsFirstValueWithMixedTypes'. (undefined)
(StaticAccess)
111-111: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsFirstValueWithMixedTypes'. (undefined)
(StaticAccess)
112-112: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsFirstValueWithMixedTypes'. (undefined)
(StaticAccess)
🔇 Additional comments (9)
.php-cs-fixer.php (1)
16-18: LGTM! PHP 8.2 migration rules properly configured.The added rules align well with the PHP 8.2 migration:
@PHP8x2Migration:riskyapplies PHP 8.2 transformationsphp_unit_attributesenforces attribute-based test discoveryno_empty_phpdocremoves obsolete empty PHPDoc blockstests/KeysTest.php (1)
11-169: LGTM! Test methods correctly migrated to PHP 8 attributes.All test methods now use
#[\PHPUnit\Framework\Attributes\Test]attribute syntax, which is the correct approach for PHPUnit 11 and PHP 8.2+. The migration preserves all test logic and assertions.tests/FirstTest.php (1)
11-122: LGTM! Test attribute migration completed correctly.All test methods properly use the
#[\PHPUnit\Framework\Attributes\Test]attribute, maintaining consistency with the PHP 8.2+ migration across the test suite.tests/FilterTest.php (1)
12-162: LGTM! Test methods successfully migrated to attributes.All test methods correctly use PHP 8 attribute syntax for test discovery, which is appropriate for PHPUnit 11 and PHP 8.2+.
tests/IsEmptyTest.php (1)
11-107: LGTM! Attribute migration completed successfully.All test methods correctly use PHP 8 attribute syntax for PHPUnit test discovery, aligning with the PHP 8.2+ migration goals.
phpunit.xml.dist (1)
1-15: LGTM! PHPUnit configuration updated to modern format.The changes correctly migrate from the deprecated
filter/whitelistsyntax to the modernsource/includestructure required by PHPUnit 11. The added XML declaration and bootstrap attribute are proper additions for the updated configuration schema.tests/IsNotEmptyTest.php (1)
11-115: LGTM! Attribute-based test discovery properly implemented.All test methods successfully migrated to PHP 8 attribute syntax, consistent with the PHPUnit 11 and PHP 8.2+ requirements.
tests/MapTest.php (1)
11-145: LGTM! Test methods migrated to attribute syntax.All test methods correctly use
#[\PHPUnit\Framework\Attributes\Test]attribute, completing the migration to PHP 8.2+ test discovery conventions.tests/MapWithKeysTest.php (1)
11-11: LGTM! Clean migration to PHP 8+ attributes.All 12 test methods have been correctly migrated from docblock
@testannotations to the PHP 8+ attribute syntax#[\PHPUnit\Framework\Attributes\Test]. This migration aligns with PHPUnit 11 requirements and PHP 8.2+ best practices.Based on learnings.
Also applies to: 24-24, 35-35, 46-46, 61-61, 74-74, 87-87, 110-110, 123-123, 141-141, 156-156, 167-167
No description provided.