Skip to content

Commit

Permalink
Merge pull request #9 from jesperbjoernandersen/php8.1-str_contains
Browse files Browse the repository at this point in the history
Added nullcoalescing to 'wantsXml'
  • Loading branch information
mtownsend5512 authored Oct 9, 2022
2 parents 976b5d8 + 57a2187 commit 352c0ec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Providers/RequestXmlServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function register()
protected function registerWantsXml()
{
Request::macro('wantsXml', function () {
return Str::contains($this->header('Accept'), 'xml');
return Str::contains($this->header('Accept') ?? '', 'xml');
});
}

Expand Down

0 comments on commit 352c0ec

Please sign in to comment.