Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonkelly committed Mar 20, 2024
1 parent 10675b9 commit 10e0ce3
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/Fs.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@ public static function displayName(): string
public string $bucketSelectionMode = 'choose';

/**
* @var ?string Default object visibility (null, 'public', 'private')
* If null, visibility will be determined by self::$hasUrls
* @var string|null The default object visibility (`public` or `private`).
* If `null`, visibility will be determined by [[$hasUrls]].
* @since 2.2.0
*/
public ?string $visibility = null;

Expand Down Expand Up @@ -122,7 +123,7 @@ public function rules(): array
$rules[] = [
['visibility'],
'in',
'range' => array_keys($this->getVisibilityOptions()),
'range' => [Visibility::PUBLIC, Visibility::PRIVATE],
'strict' => true,
];
return $rules;
Expand All @@ -131,9 +132,9 @@ public function rules(): array
public function getVisibilityOptions(): array
{
return [
null => Craft::t('google-cloud', 'Automatic'),
Visibility::PUBLIC => Craft::t('google-cloud', 'Public'),
Visibility::PRIVATE => Craft::t('google-cloud', 'Private'),
['value' => '', 'label' => Craft::t('google-cloud', 'Automatic')],
['value' => Visibility::PUBLIC, 'label' => Craft::t('google-cloud', 'Public')],
['value' => Visibility::PRIVATE, 'label' => Craft::t('google-cloud', 'Private')],
];
}

Expand Down Expand Up @@ -338,6 +339,9 @@ private static function _buildConfigArray(string $projectId, string $keyFileCont
return $config;
}

/**
* @inheritdoc
*/
protected function visibility(): string
{
return $this->visibility ?? parent::visibility();
Expand Down

0 comments on commit 10e0ce3

Please sign in to comment.