formatter
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Mathieu 2024-01-12 12:26:11 +00:00
parent 037ed54ed9
commit 023e55c1bf
3 changed files with 9 additions and 6 deletions

View File

@ -5,4 +5,7 @@
"php.validate.executablePath": "/usr/local/bin/php", "php.validate.executablePath": "/usr/local/bin/php",
"php.validate.enable": true, "php.validate.enable": true,
"php.validate.run": "onType", "php.validate.run": "onType",
} "[php]": {
"editor.defaultFormatter": "bmewburn.vscode-intelephense-client"
}
}

View File

@ -27,7 +27,7 @@ class MultiDownloaderClient
throw new \InvalidArgumentException('API key is required'); throw new \InvalidArgumentException('API key is required');
} }
$this->apiKey = $apiKey; $this->apiKey = $apiKey;
$apiSecret = $options['apiSecret'] ?? getenv('MULTI_DOWNLOADER_SECRET_KEY'); $apiSecret = $options['apiSecret'] ?? getenv('MULTI_DOWNLOADER_SECRET_KEY');
if (!$apiSecret) { if (!$apiSecret) {
throw new \InvalidArgumentException('API secret key is required'); throw new \InvalidArgumentException('API secret key is required');
@ -41,7 +41,7 @@ class MultiDownloaderClient
{ {
$this->files = []; $this->files = [];
$this->addFiles($files); $this->addFiles($files);
return $this; return $this;
} }

View File

@ -22,7 +22,7 @@ class MultiDownloaderClientTest extends TestCase
public function testDownloadAsString() public function testDownloadAsString()
{ {
$client = new MultiDownloaderClient(['apiKey' => 'test', 'apiSecret' => 'test' ]); $client = new MultiDownloaderClient(['apiKey' => 'test', 'apiSecret' => 'test']);
$client->setFiles($this->testFiles()); $client->setFiles($this->testFiles());
@ -35,7 +35,7 @@ class MultiDownloaderClientTest extends TestCase
public function testDownloadTo() public function testDownloadTo()
{ {
$client = new MultiDownloaderClient(['apiKey' => 'test', 'apiSecret' => 'test' ]); $client = new MultiDownloaderClient(['apiKey' => 'test', 'apiSecret' => 'test']);
$path = sys_get_temp_dir() . '/testDownloadTo.zip'; $path = sys_get_temp_dir() . '/testDownloadTo.zip';
@ -50,7 +50,7 @@ class MultiDownloaderClientTest extends TestCase
public function testForm() public function testForm()
{ {
$client = new MultiDownloaderClient(['apiKey' => 'test', 'apiSecret' => 'test' ]); $client = new MultiDownloaderClient(['apiKey' => 'test', 'apiSecret' => 'test']);
$client->setFiles($this->testFiles()); $client->setFiles($this->testFiles());
echo $client->htmlForm($this->testFiles()); echo $client->htmlForm($this->testFiles());