Skip to content

Commit 4a85fd4

Browse files
committed
do not fail with default config
1 parent ec2250a commit 4a85fd4

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/Helpers/ConfigurationValidator.php

+8
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@ public static function validate(?array $feeds = null): void
2828

2929
protected static function validateFeedItemsResolver($resolver): bool
3030
{
31+
if ($resolver === null) {
32+
return true;
33+
}
34+
35+
if ($resolver === '') {
36+
return true;
37+
}
38+
3139
if (! is_string($resolver) && ! is_array($resolver)) {
3240
return false;
3341
}

tests/ConfigurationValidatorTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function it_throws_an_exception_for_an_invalid_items_value()
5050
{
5151
$exceptionCounter = 0;
5252

53-
$invalidItems = ['', null, [], ['test']];
53+
$invalidItems = [[], ['test']];
5454
$validItems = ['Model@getAll', ['App\\Model', 'getItems'], ['App\\Model', 'getItems', 'param1']];
5555

5656
$items = array_merge($invalidItems, $validItems);

0 commit comments

Comments
 (0)