Skip to content

Commit 035f9e8

Browse files
authored
Merge pull request #5 from bolt/bobdenotter-patch-1
Default fallback to `new Collection()`
2 parents ba0f5b4 + 20588e5 commit 035f9e8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/NewsWidget.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
use Bolt\Widget\StopwatchTrait;
1919
use Bolt\Widget\TwigAwareInterface;
2020
use Symfony\Component\HttpClient\HttpClient;
21+
use Tightenco\Collect\Support\Collection;
2122

2223
class NewsWidget extends BaseWidget implements TwigAwareInterface, RequestAwareInterface, CacheAwareInterface, StopwatchAwareInterface
2324
{
@@ -145,7 +146,8 @@ private function fetchNewsOptions(): array
145146
'env' => $this->getExtension()->getContainer()->getParameter('kernel.environment'),
146147
];
147148

148-
$curlOptions = $config->get('general/curl_options', [])->all();
149+
$curlOptions = $config->get('general/curl_options', new Collection([]))->all();
150+
149151
$curlOptions['timeout'] = 6;
150152
$curlOptions['query'] = [
151153
'hash' => base64_encode(serialize($parameters)),

0 commit comments

Comments
 (0)