-
Notifications
You must be signed in to change notification settings - Fork 0
Add filter method, split tests & add more edge cases, code style #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Caution Review failedThe pull request is closed. WalkthroughAdds Iterables::filter (preserving keys; yields entries only when callback returns boolean true), many new focused unit tests for Iterables utilities, removes an older consolidated test file, and updates CI: expands GitHub Actions PHPUnit matrix to include PHP 8.5. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Caller
participant Filter as Iterables::filter
participant CB as callback(value, key)
Caller->>Filter: filter(iterable, callback)
loop for each key,value in iterable
Filter->>CB: invoke(value, key)
alt returns === true
Note right of Filter #E6F7FF: yield preserved key => value
Filter-->>Caller: yield key => value
else
Note right of Filter #FFF3E6: skip entry
end
end
Filter-->>Caller: complete Generator
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20–30 minutes Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: ASSERTIVE Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (14)
Comment |
Pull Request Test Coverage Report for Build 18282606420Details
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 6
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.github/workflows/phpunit.yaml (1)
46-46: Update Coveralls carryforward for new matrix flagInclude phpunit-8.5 so the finish step considers all jobs.
- carryforward: "phpunit-8.1,phpunit-8.2,phpunit-8.3,phpunit-8.4" + carryforward: "phpunit-8.1,phpunit-8.2,phpunit-8.3,phpunit-8.4,phpunit-8.5"
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (10)
.github/workflows/phpunit.yaml(1 hunks)src/Iterables.php(1 hunks)tests/FilterTest.php(1 hunks)tests/FirstTest.php(1 hunks)tests/IsEmptyTest.php(1 hunks)tests/IsNotEmptyTest.php(1 hunks)tests/IterablesTest.php(0 hunks)tests/KeysTest.php(1 hunks)tests/MapTest.php(1 hunks)tests/MapWithKeysTest.php(1 hunks)
💤 Files with no reviewable changes (1)
- tests/IterablesTest.php
🧰 Additional context used
🧬 Code graph analysis (7)
tests/IsEmptyTest.php (3)
src/Iterables.php (2)
Iterables(7-115)isEmpty(65-72)tests/TestCase.php (1)
TestCase(7-10)tests/IsNotEmptyTest.php (6)
itHandlesEmptyGenerator(70-78)itHandlesNonEmptyGenerator(83-90)itHandlesEmptyArrayObject(95-99)itHandlesNonEmptyArrayObject(104-108)itHandlesArrayIterator(113-120)itHandlesSingleElementIterables(125-130)
tests/MapTest.php (1)
src/Iterables.php (2)
Iterables(7-115)map(19-24)
tests/IsNotEmptyTest.php (2)
src/Iterables.php (2)
Iterables(7-115)isNotEmpty(79-82)tests/IsEmptyTest.php (6)
itHandlesEmptyGenerator(70-78)itHandlesNonEmptyGenerator(83-90)itHandlesEmptyArrayObject(95-99)itHandlesNonEmptyArrayObject(104-108)itHandlesArrayIterator(113-120)itHandlesSingleElementIterables(125-130)
tests/FilterTest.php (1)
src/Iterables.php (2)
Iterables(7-115)filter(107-114)
tests/MapWithKeysTest.php (1)
src/Iterables.php (2)
Iterables(7-115)mapWithKeys(37-42)
tests/KeysTest.php (2)
src/Iterables.php (2)
Iterables(7-115)keys(91-96)tests/TestCase.php (1)
TestCase(7-10)
tests/FirstTest.php (2)
src/Iterables.php (2)
Iterables(7-115)first(51-58)tests/TestCase.php (1)
TestCase(7-10)
🪛 PHPMD (2.15.0)
tests/IsEmptyTest.php
9-131: The class IsEmptyTest has 12 public methods. Consider refactoring IsEmptyTest to keep number of public methods under 10. (undefined)
(TooManyPublicMethods)
16-16: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsIfIterableIsEmpty'. (undefined)
(StaticAccess)
17-17: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsIfIterableIsEmpty'. (undefined)
(StaticAccess)
25-25: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsTrueForEmptyArrayWithMixedKeys'. (undefined)
(StaticAccess)
26-26: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsTrueForEmptyArrayWithMixedKeys'. (undefined)
(StaticAccess)
34-34: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsFalseForArrayWithNullValue'. (undefined)
(StaticAccess)
35-35: 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 'itReturnsFalseForArrayWithFalsyValues'. (undefined)
(StaticAccess)
44-44: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsFalseForArrayWithFalsyValues'. (undefined)
(StaticAccess)
45-45: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsFalseForArrayWithFalsyValues'. (undefined)
(StaticAccess)
46-46: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsFalseForArrayWithFalsyValues'. (undefined)
(StaticAccess)
54-54: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsFalseForArrayWithStringKeys'. (undefined)
(StaticAccess)
55-55: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsFalseForArrayWithStringKeys'. (undefined)
(StaticAccess)
63-63: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsFalseForArrayWithNumericKeys'. (undefined)
(StaticAccess)
64-64: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsFalseForArrayWithNumericKeys'. (undefined)
(StaticAccess)
77-77: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itHandlesEmptyGenerator'. (undefined)
(StaticAccess)
89-89: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itHandlesNonEmptyGenerator'. (undefined)
(StaticAccess)
97-97: Missing class import via use statement (line '97', column '33'). (undefined)
(MissingImport)
98-98: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itHandlesEmptyArrayObject'. (undefined)
(StaticAccess)
106-106: Missing class import via use statement (line '106', column '28'). (undefined)
(MissingImport)
107-107: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itHandlesNonEmptyArrayObject'. (undefined)
(StaticAccess)
115-115: Missing class import via use statement (line '115', column '30'). (undefined)
(MissingImport)
116-116: Missing class import via use statement (line '116', column '33'). (undefined)
(MissingImport)
118-118: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itHandlesArrayIterator'. (undefined)
(StaticAccess)
119-119: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itHandlesArrayIterator'. (undefined)
(StaticAccess)
127-127: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itHandlesSingleElementIterables'. (undefined)
(StaticAccess)
128-128: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itHandlesSingleElementIterables'. (undefined)
(StaticAccess)
129-129: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itHandlesSingleElementIterables'. (undefined)
(StaticAccess)
tests/MapTest.php
9-167: The class MapTest has 11 public methods. Consider refactoring MapTest to keep number of public methods under 10. (undefined)
(TooManyPublicMethods)
16-19: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itMapsIterableViaGivenCallback'. (undefined)
(StaticAccess)
29-32: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itMapsEmptyIterable'. (undefined)
(StaticAccess)
31-31: Avoid unused parameters such as '$value'. (undefined)
(UnusedFormalParameter)
42-45: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itMapsSingleElementIterable'. (undefined)
(StaticAccess)
55-58: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itMapsWithNullValues'. (undefined)
(StaticAccess)
68-71: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itMapsWithMixedTypes'. (undefined)
(StaticAccess)
81-84: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itMapsWithStringKeys'. (undefined)
(StaticAccess)
94-97: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itMapsWithNumericKeys'. (undefined)
(StaticAccess)
113-116: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itMapsGenerator'. (undefined)
(StaticAccess)
126-126: Missing class import via use statement (line '126', column '28'). (undefined)
(MissingImport)
128-131: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itMapsArrayObject'. (undefined)
(StaticAccess)
141-144: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itMapsWithCallbackUsingBothValueAndKey'. (undefined)
(StaticAccess)
160-163: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itMapsPreservingOriginalKeys'. (undefined)
(StaticAccess)
tests/IsNotEmptyTest.php
9-141: The class IsNotEmptyTest has 13 public methods. Consider refactoring IsNotEmptyTest to keep number of public methods under 10. (undefined)
(TooManyPublicMethods)
16-16: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsIfIterableIsNotEmpty'. (undefined)
(StaticAccess)
17-17: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsIfIterableIsNotEmpty'. (undefined)
(StaticAccess)
25-25: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsFalseForEmptyArrayWithMixedKeys'. (undefined)
(StaticAccess)
26-26: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsFalseForEmptyArrayWithMixedKeys'. (undefined)
(StaticAccess)
34-34: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsTrueForArrayWithNullValue'. (undefined)
(StaticAccess)
35-35: 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 'itReturnsTrueForArrayWithFalsyValues'. (undefined)
(StaticAccess)
44-44: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsTrueForArrayWithFalsyValues'. (undefined)
(StaticAccess)
45-45: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsTrueForArrayWithFalsyValues'. (undefined)
(StaticAccess)
46-46: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsTrueForArrayWithFalsyValues'. (undefined)
(StaticAccess)
54-54: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsTrueForArrayWithStringKeys'. (undefined)
(StaticAccess)
55-55: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsTrueForArrayWithStringKeys'. (undefined)
(StaticAccess)
63-63: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsTrueForArrayWithNumericKeys'. (undefined)
(StaticAccess)
64-64: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsTrueForArrayWithNumericKeys'. (undefined)
(StaticAccess)
77-77: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itHandlesEmptyGenerator'. (undefined)
(StaticAccess)
89-89: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itHandlesNonEmptyGenerator'. (undefined)
(StaticAccess)
97-97: Missing class import via use statement (line '97', column '33'). (undefined)
(MissingImport)
98-98: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itHandlesEmptyArrayObject'. (undefined)
(StaticAccess)
106-106: Missing class import via use statement (line '106', column '28'). (undefined)
(MissingImport)
107-107: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itHandlesNonEmptyArrayObject'. (undefined)
(StaticAccess)
115-115: Missing class import via use statement (line '115', column '30'). (undefined)
(MissingImport)
116-116: Missing class import via use statement (line '116', column '33'). (undefined)
(MissingImport)
118-118: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itHandlesArrayIterator'. (undefined)
(StaticAccess)
119-119: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itHandlesArrayIterator'. (undefined)
(StaticAccess)
127-127: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itHandlesSingleElementIterables'. (undefined)
(StaticAccess)
128-128: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itHandlesSingleElementIterables'. (undefined)
(StaticAccess)
129-129: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itHandlesSingleElementIterables'. (undefined)
(StaticAccess)
137-137: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itHandlesMultipleElementIterables'. (undefined)
(StaticAccess)
138-138: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itHandlesMultipleElementIterables'. (undefined)
(StaticAccess)
139-139: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itHandlesMultipleElementIterables'. (undefined)
(StaticAccess)
tests/FilterTest.php
9-187: The class FilterTest has 13 public methods. Consider refactoring FilterTest to keep number of public methods under 10. (undefined)
(TooManyPublicMethods)
16-19: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itFiltersIterableWithCallback'. (undefined)
(StaticAccess)
29-32: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itFiltersEmptyIterable'. (undefined)
(StaticAccess)
31-31: Avoid unused parameters such as '$value'. (undefined)
(UnusedFormalParameter)
42-45: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itFiltersWithNoMatches'. (undefined)
(StaticAccess)
55-58: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itFiltersWithAllMatches'. (undefined)
(StaticAccess)
57-57: Avoid unused parameters such as '$value'. (undefined)
(UnusedFormalParameter)
68-71: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itFiltersWithNullValues'. (undefined)
(StaticAccess)
81-84: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itFiltersWithMixedTypes'. (undefined)
(StaticAccess)
94-97: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itFiltersWithKeyBasedCallback'. (undefined)
(StaticAccess)
96-96: Avoid unused parameters such as '$value'. (undefined)
(UnusedFormalParameter)
107-110: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itFiltersWithStrictBooleanCheck'. (undefined)
(StaticAccess)
120-123: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itFiltersWithCallbackReturningNonBoolean'. (undefined)
(StaticAccess)
133-136: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itFiltersWithCallbackReturningTruthyButNotTrue'. (undefined)
(StaticAccess)
146-149: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itFiltersStringKeys'. (undefined)
(StaticAccess)
148-148: Avoid unused parameters such as '$value'. (undefined)
(UnusedFormalParameter)
165-168: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itFiltersGenerator'. (undefined)
(StaticAccess)
178-178: Missing class import via use statement (line '178', column '28'). (undefined)
(MissingImport)
180-183: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itFiltersArrayObject'. (undefined)
(StaticAccess)
tests/MapWithKeysTest.php
9-204: The class MapWithKeysTest has 12 public methods. Consider refactoring MapWithKeysTest to keep number of public methods under 10. (undefined)
(TooManyPublicMethods)
16-21: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itMapsIterableWithKeysViaGivenCallable'. (undefined)
(StaticAccess)
31-34: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itMapsEmptyIterable'. (undefined)
(StaticAccess)
33-33: Avoid unused parameters such as '$value'. (undefined)
(UnusedFormalParameter)
44-47: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itMapsSingleElementIterable'. (undefined)
(StaticAccess)
57-64: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itMapsWithMultipleKeysPerElement'. (undefined)
(StaticAccess)
74-79: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itMapsWithNullValues'. (undefined)
(StaticAccess)
89-94: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itMapsWithMixedTypes'. (undefined)
(StaticAccess)
104-110: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itMapsWithOriginalKeys'. (undefined)
(StaticAccess)
129-134: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itMapsWithNumericKeys'. (undefined)
(StaticAccess)
149-154: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itMapsGenerator'. (undefined)
(StaticAccess)
164-164: Missing class import via use statement (line '164', column '28'). (undefined)
(MissingImport)
166-171: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itMapsArrayObject'. (undefined)
(StaticAccess)
181-184: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itMapsWithEmptyArrayReturned'. (undefined)
(StaticAccess)
183-183: Avoid unused parameters such as '$value'. (undefined)
(UnusedFormalParameter)
194-199: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itMapsWithOverlappingKeys'. (undefined)
(StaticAccess)
tests/KeysTest.php
9-203: The class KeysTest has 17 public methods. Consider refactoring KeysTest to keep number of public methods under 10. (undefined)
(TooManyPublicMethods)
16-19: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsKeys'. (undefined)
(StaticAccess)
29-29: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsEmptyArrayForEmptyIterable'. (undefined)
(StaticAccess)
38-38: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsSingleKey'. (undefined)
(StaticAccess)
41-41: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsSingleKey'. (undefined)
(StaticAccess)
50-50: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsNumericKeys'. (undefined)
(StaticAccess)
53-53: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsNumericKeys'. (undefined)
(StaticAccess)
62-62: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsNegativeNumericKeys'. (undefined)
(StaticAccess)
71-71: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsStringKeys'. (undefined)
(StaticAccess)
80-80: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsEmptyStringKey'. (undefined)
(StaticAccess)
89-89: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsMixedKeyTypes'. (undefined)
(StaticAccess)
98-98: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsKeysWithNullValues'. (undefined)
(StaticAccess)
107-113: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsKeysWithFalsyValues'. (undefined)
(StaticAccess)
129-129: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsKeysFromGenerator'. (undefined)
(StaticAccess)
143-143: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsEmptyForEmptyGenerator'. (undefined)
(StaticAccess)
152-152: Missing class import via use statement (line '152', column '28'). (undefined)
(MissingImport)
153-153: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsKeysFromArrayObject'. (undefined)
(StaticAccess)
162-162: Missing class import via use statement (line '162', column '33'). (undefined)
(MissingImport)
163-163: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsEmptyForEmptyArrayObject'. (undefined)
(StaticAccess)
172-172: Missing class import via use statement (line '172', column '25'). (undefined)
(MissingImport)
173-173: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsKeysFromArrayIterator'. (undefined)
(StaticAccess)
183-183: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itPreservesKeyOrder'. (undefined)
(StaticAccess)
186-186: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itPreservesKeyOrder'. (undefined)
(StaticAccess)
195-199: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsKeysWithComplexValues'. (undefined)
(StaticAccess)
197-197: Missing class import via use statement (line '197', column '29'). (undefined)
(MissingImport)
tests/FirstTest.php
9-148: The class FirstTest has 13 public methods. Consider refactoring FirstTest to keep number of public methods under 10. (undefined)
(TooManyPublicMethods)
18-18: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsFirstValueInIterable'. (undefined)
(StaticAccess)
27-27: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsNullIfIterableIsEmptyWhileGettingFirstValue'. (undefined)
(StaticAccess)
35-35: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsFirstValueFromSingleElementIterable'. (undefined)
(StaticAccess)
36-36: 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 'itReturnsFirstValueFromSingleElementIterable'. (undefined)
(StaticAccess)
45-45: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsNullAsFirstValue'. (undefined)
(StaticAccess)
46-46: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsNullAsFirstValue'. (undefined)
(StaticAccess)
54-54: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsFalsyValuesAsFirst'. (undefined)
(StaticAccess)
55-55: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsFalsyValuesAsFirst'. (undefined)
(StaticAccess)
56-56: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsFalsyValuesAsFirst'. (undefined)
(StaticAccess)
57-57: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsFalsyValuesAsFirst'. (undefined)
(StaticAccess)
65-65: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsFirstValueWithStringKeys'. (undefined)
(StaticAccess)
66-66: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsFirstValueWithStringKeys'. (undefined)
(StaticAccess)
74-74: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsFirstValueWithNumericKeys'. (undefined)
(StaticAccess)
75-75: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsFirstValueWithNumericKeys'. (undefined)
(StaticAccess)
89-89: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsFirstValueFromGenerator'. (undefined)
(StaticAccess)
102-102: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsNullFromEmptyGenerator'. (undefined)
(StaticAccess)
110-110: Missing class import via use statement (line '110', column '28'). (undefined)
(MissingImport)
111-111: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsFirstValueFromArrayObject'. (undefined)
(StaticAccess)
113-113: Missing class import via use statement (line '113', column '33'). (undefined)
(MissingImport)
114-114: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsFirstValueFromArrayObject'. (undefined)
(StaticAccess)
122-122: Missing class import via use statement (line '122', column '25'). (undefined)
(MissingImport)
123-123: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsFirstValueFromArrayIterator'. (undefined)
(StaticAccess)
125-125: Missing class import via use statement (line '125', column '30'). (undefined)
(MissingImport)
126-126: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsFirstValueFromArrayIterator'. (undefined)
(StaticAccess)
134-134: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsFirstValueWithMixedTypes'. (undefined)
(StaticAccess)
135-135: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsFirstValueWithMixedTypes'. (undefined)
(StaticAccess)
136-136: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsFirstValueWithMixedTypes'. (undefined)
(StaticAccess)
145-145: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsFirstValueRegardlessOfKeyOrder'. (undefined)
(StaticAccess)
146-146: Avoid using static access to class '\Bonu\Iterable\Iterables' in method 'itReturnsFirstValueRegardlessOfKeyOrder'. (undefined)
(StaticAccess)
🪛 YAMLlint (1.37.1)
.github/workflows/phpunit.yaml
[error] 14-14: too many spaces inside brackets
(brackets)
[error] 14-14: too many spaces inside brackets
(brackets)
🔇 Additional comments (5)
tests/KeysTest.php (1)
1-203: Comprehensive coverage for keys() — looks goodScenarios are thorough and align with implementation.
tests/FirstTest.php (1)
1-148: Excellent test coverage forIterables::first().This test suite comprehensively validates the
first()method across diverse scenarios including empty inputs, falsy values, null handling, various key types, and different iterable implementations. The edge case coverage is thorough and well-structured.tests/MapTest.php (1)
1-167: Excellent test coverage forIterables::map().This test suite thoroughly validates the
map()method including key preservation, value transformation with various callback types, and proper handling of different iterable implementations. The tests appropriately verify that both value and key are passed to callbacks.tests/MapWithKeysTest.php (1)
1-204: Excellent test coverage forIterables::mapWithKeys().This test suite comprehensively validates the
mapWithKeys()method including multiple keys per input element, empty array handling, and overlapping key behavior (where later values correctly overwrite earlier ones). The test coverage properly exercises theyield fromimplementation.tests/FilterTest.php (1)
1-187: Excellent test coverage forIterables::filter()with proper strict comparison validation.This test suite comprehensively validates the
filter()method including the critical strict=== truecomparison behavior. The tests at lines 118-126 and 131-139 properly verify that only callbacks returning exactlytruewill include elements, not truthy values or integers. This ensures the filter implementation's type safety is well-tested.
No description provided.