Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/Client/AdobeStock.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class AdobeStock
* @param string $target_env Target Environment Prod/Stage
* @param HttpInterface $http_client Custom http client
*/
public function __construct(string $api_key, string $product, string $target_env, HttpInterface $http_client = null)
public function __construct(string $api_key, string $product, string $target_env, ?HttpInterface $http_client = null)
{
$this->_config = new CoreConfig($api_key, $product, $target_env);
$this->_search_category_factory = new SearchCategoryFactory($this->_config);
Expand Down Expand Up @@ -143,7 +143,7 @@ public function searchCategoryTree(SearchCategoryRequest $request, string $acces
* @return FilesResponse
* @throws StockApiException
*/
public function getFiles(FilesRequest $request, string $access_token = null) : FilesResponse
public function getFiles(FilesRequest $request, ?string $access_token = null) : FilesResponse
{
return $this->_files_factory->getFiles($request, $this->_http_client, $access_token);
}
Expand All @@ -154,7 +154,7 @@ public function getFiles(FilesRequest $request, string $access_token = null) : F
* @param string $access_token
* @return AdobeStock
*/
public function searchFilesInitialize(SearchFilesRequest $request, string $access_token = null) : AdobeStock
public function searchFilesInitialize(SearchFilesRequest $request, ?string $access_token = null) : AdobeStock
{
$this->_search_files_factory->searchFilesInitialize($request, $access_token, $this->_http_client, true);
return $this;
Expand Down Expand Up @@ -331,7 +331,7 @@ public function downloadAssetStream(LicenseRequest $request, string $access_toke
* @param string $access_token Access token
* @return AdobeStock
*/
public function initializeLicenseHistory(LicenseHistoryRequest $request, string $access_token = null) : AdobeStock
public function initializeLicenseHistory(LicenseHistoryRequest $request, ?string $access_token = null) : AdobeStock
{
$this->_license_history_factory->initializeLicenseHistory($request, $access_token, $this->_http_client);
return $this;
Expand Down
4 changes: 2 additions & 2 deletions src/Client/Files.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function __construct(CoreConfig $config)
public function getFiles(
FilesRequest $file_request,
HttpClientInterface $http_client,
string $access_token = null
?string $access_token = null
) : FilesResponse {
$this->_validateRequest($file_request, $access_token);
$response_json = $http_client->doGet(
Expand All @@ -64,7 +64,7 @@ public function getFiles(
* @param string $access_token
* @throws StockApiException
*/
private function _validateRequest(FilesRequest $request, string $access_token = null) : void
private function _validateRequest(FilesRequest $request, ?string $access_token = null) : void
{
if (!empty($request->getResultColumns())) {
if (in_array('is_licensed', $request->getResultColumns()) && $access_token === null) {
Expand Down
2 changes: 1 addition & 1 deletion src/Client/Http/HttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class HttpClient implements HttpInterface
* Constructor
* @param Client $client GuzzleClient
*/
public function __construct(Client $client = null)
public function __construct(?Client $client = null)
{
if ($client === null) {
$client = new Client();
Expand Down
2 changes: 1 addition & 1 deletion src/Client/License.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ protected function _getDownloadUrl(): string
* @param string $url
* @param string $access_token
*/
protected function _setDownloadUrl(string $url, string $access_token = null)
protected function _setDownloadUrl(string $url, ?string $access_token = null)
{
if ($access_token) {
$url .= '?token=' . $access_token;
Expand Down
Loading