Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
sergix44 authored and github-actions[bot] committed Aug 4, 2023
1 parent 30295b9 commit a60837b
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,7 @@ class Client extends RemoteClient

private ?string $hfToken;

/**
* @param string $src
* @param string|null $hfToken
* @param Config|null $config
*/
public function __construct(string $src, ?string $hfToken = null, Config $config = null)
public function __construct(string $src, string $hfToken = null, Config $config = null)
{
parent::__construct($src);
$this->config = $config ?? $this->get(self::HTTP_CONFIG, dto: Config::class);
Expand Down Expand Up @@ -110,17 +105,19 @@ private function preparePayload(array $arguments): array
$contents = stream_get_contents($filename);
$finfo = new \finfo(FILEINFO_MIME_TYPE);
$mime = $finfo->buffer($contents);

return [
'data' => "data:$mime;base64," . base64_encode($contents),
'data' => "data:$mime;base64,".base64_encode($contents),
'name' => basename($filename),
];
}

if (is_string($arg) && file_exists($arg)) {
$contents = file_get_contents($arg);
$mime = mime_content_type($arg);

return [
'data' => "data:$mime;base64," . base64_encode($contents),
'data' => "data:$mime;base64,".base64_encode($contents),
'name' => basename($arg),
];
}
Expand Down

0 comments on commit a60837b

Please sign in to comment.