unsplash / unsplash-php

👻 Official PHP wrapper for the Unsplash API
MIT License
415 stars 74 forks source link

Deprecation warning - `Photo::all` causes a deprecation warning in PHP 8.1 #125

Closed petewalker closed 2 years ago

petewalker commented 2 years ago

When calling Photo::all in PHP 8.1, it's triggering a tonne of deprecation warnings when adding utm query parameters to links returned in the images that resolve to null:

<b>Deprecated</b>: parse_url(): Passing null to parameter #1 ($url) of type string is deprecated in
<b>/app/api/vendor/unsplash/unsplash/src/Endpoint.php</b> on line <b>185</b><br />
<br />
<b>Deprecated</b>: parse_url(): Passing null to parameter #1 ($url) of type string is deprecated in
<b>/app/api/vendor/unsplash/unsplash/src/Endpoint.php</b> on line <b>185</b><br />
<br />
<b>Deprecated</b>: parse_url(): Passing null to parameter #1 ($url) of type string is deprecated in
<b>/app/api/vendor/unsplash/unsplash/src/Endpoint.php</b> on line <b>185</b><br />
<br />
<b>Deprecated</b>: parse_url(): Passing null to parameter #1 ($url) of type string is deprecated in
<b>/app/api/vendor/unsplash/unsplash/src/Endpoint.php</b> on line <b>185</b><br />
<br />
...