Skip to content

Commit

Permalink
refactor(swarm): ref check and param arg type
Browse files Browse the repository at this point in the history
  • Loading branch information
mahiarirani committed Dec 28, 2024
1 parent 70f4048 commit deca719
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/Storage/BeeSwarmTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,9 @@ public function isVersion(int $version = self::INFRASTRUCTURE_VERSION_GATEWAY):
}

/**
* @param mixed $params
*
* @throws StorageBadConfigException
*/
protected function parseParams($params): void {
protected function parseParams(array $params): void {
$this->validateParams($params);

$this->api_url = $params[BeeSwarm::OPTION_HOST_URL];
Expand Down Expand Up @@ -241,7 +239,7 @@ private function uploadSwarmV1(string $path, string $tempFile, string $mimetype)
$curl->setAuthorization($this->access_key, CURLAUTH_ANY);

$result = $curl->exec(true);
$reference = (isset($result['reference']) ? $result['reference'] : null);
$reference = ($result['reference'] ?? null);

if (!isset($reference)) {
throw new SwarmException('Failed to upload file to '.$this->id.': '.$result['message']);
Expand Down

0 comments on commit deca719

Please sign in to comment.