-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added params in UploadCommand; close #16
- Loading branch information
1 parent
7293c62
commit 55fa650
Showing
1 changed file
with
76 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -176,6 +176,62 @@ public function setMupThreshold(int $mupThreshold) | |
return $this; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getContentType(): string | ||
{ | ||
return $this->getParam('ContentType', ''); | ||
} | ||
|
||
/** | ||
* @param string $contentType | ||
* | ||
* @return $this | ||
*/ | ||
public function setContentType(string $contentType) | ||
{ | ||
$this->setParam('ContentType', $contentType); | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getContentDisposition(): string | ||
{ | ||
return $this->getParam('ContentDisposition', ''); | ||
} | ||
|
||
/** | ||
* @param string $contentDisposition | ||
* | ||
* @return $this | ||
*/ | ||
public function setContentDisposition(string $contentDisposition) | ||
{ | ||
$this->setParam('ContentDisposition', $contentDisposition); | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @return array | ||
*/ | ||
public function getParams(): array | ||
{ | ||
return $this->options['params'] ?? []; | ||
} | ||
|
||
/** | ||
* @param array $params | ||
*/ | ||
public function setParams(array $params) | ||
{ | ||
$this->options['params'] = $params; | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
frostealth
Author
Owner
|
||
} | ||
|
||
/** | ||
* @return array | ||
*/ | ||
|
@@ -195,4 +251,24 @@ public function beforeUpload(callable $beforeUpload) | |
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @param string $name | ||
* @param mixed $default | ||
* | ||
* @return mixed | ||
*/ | ||
protected function getParam(string $name, $default) | ||
{ | ||
return $this->options['params'][$name] ?? $default; | ||
} | ||
|
||
/** | ||
* @param string $name | ||
* @param mixed $value | ||
*/ | ||
protected function setParam(string $name, $value) | ||
{ | ||
$this->options['params'][$name] = $value; | ||
} | ||
This comment has been minimized.
Sorry, something went wrong. |
||
} |
Any reason this method doesn't
return $this;
? - This breaks the fluid interface. Now I have to use the following code:Instead of the more convenient: