CodeExplorer GoogleCloudStorageAdapter example
$options =
$this->
resolveStorageConfig($config);
$storageConfig =
['projectId' =>
$options['projectId'
]];
if (isset($config['keyFile'
])) { $storageConfig['keyFile'
] =
$options['keyFile'
];
} else { $storageConfig['keyFilePath'
] =
$options['keyFilePath'
];
} $bucket =
(new StorageClient($storageConfig))->
bucket($options['bucket'
]);
return new GoogleCloudStorageAdapter($bucket,
$options['root'
]);
} public function getType(): string
{ return 'google-storage';
} private function resolveStorageConfig(array
$definition): array
{ $options =
new OptionsResolver();