Skip to content

Commit

Permalink
Merge pull request #81 from beschoenen/fix/config-error-80
Browse files Browse the repository at this point in the history
Use Arr::get to access all config entries
  • Loading branch information
freekmurze authored Nov 25, 2023
2 parents 8a0b003 + 086ae5a commit c26ab07
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/GoogleCloudStorageAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ public function url($path)
{
$storageApiUri = rtrim(Rest::DEFAULT_API_ENDPOINT, '/').'/'.ltrim(Arr::get($this->config, 'bucket'), '/');

Check failure on line 34 in src/GoogleCloudStorageAdapter.php

View workflow job for this annotation

GitHub Actions / psalm

InternalClass

src/GoogleCloudStorageAdapter.php:34:32: InternalClass: Google\Cloud\Storage\Connection\Rest is internal to Google but called from Spatie\GoogleCloudStorage\GoogleCloudStorageAdapter (see https://psalm.dev/174)

Check failure on line 34 in src/GoogleCloudStorageAdapter.php

View workflow job for this annotation

GitHub Actions / psalm

InternalClass

src/GoogleCloudStorageAdapter.php:34:32: InternalClass: Google\Cloud\Storage\Connection\Rest is internal to Google but called from Spatie\GoogleCloudStorage\GoogleCloudStorageAdapter (see https://psalm.dev/174)

if ($this->config['storageApiUri']) {
$storageApiUri = $this->config['storageApiUri'];
if (Arr::get($this->config, 'storageApiUri')) {
$storageApiUri = Arr::get($this->config, 'storageApiUri');
}

return $this->concatPathToUrl($storageApiUri, $this->prefixer->prefixPath($path));
Expand All @@ -50,8 +50,8 @@ public function url($path)
*/
public function temporaryUrl($path, $expiration, array $options = [])
{
if ($this->config['storageApiUri']) {
$options['bucketBoundHostname'] = $this->config['storageApiUri'];
if (Arr::get($this->config, 'storageApiUri')) {
$options['bucketBoundHostname'] = Arr::get($this->config, 'storageApiUri');
}

return $this->getBucket()->object($this->prefixer->prefixPath($path))->signedUrl($expiration, $options);
Expand All @@ -67,8 +67,8 @@ public function temporaryUrl($path, $expiration, array $options = [])
*/
public function temporaryUploadUrl($path, $expiration, array $options = [])
{
if ($this->config['storageApiUri']) {
$options['bucketBoundHostname'] = $this->config['storageApiUri'];
if (Arr::get($this->config, 'storageApiUri')) {
$options['bucketBoundHostname'] = Arr::get($this->config, 'storageApiUri');
}

return $this->getBucket()->object($this->prefixer->prefixPath($path))->beginSignedUploadSession($options);
Expand Down

0 comments on commit c26ab07

Please sign in to comment.