Skip to content

Commit

Permalink
Merge pull request #12 from yunpian/1.0.1
Browse files Browse the repository at this point in the history
1.0.1
  • Loading branch information
dzh authored Mar 27, 2017
2 parents a86fdb3 + 2dc295e commit ca3a6e0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/Api/TplApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

/**
* https://www.yunpian.com/api2.0/tpl.html
*
*
* @author dzh
* @since 1.0
*/
Expand Down Expand Up @@ -206,7 +206,7 @@ function update(array $param) {
case self::VERSION_V1:
return $rsp[self::TEMPLATE];
case self::VERSION_V2:
return $rsp[self::TEMPLATE];
return array_key_exists(self::TEMPLATE, $rsp) ? $rsp[self::TEMPLATE] : $rsp;
}
return null;
});
Expand Down
10 changes: 5 additions & 5 deletions src/Model/Result.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function isSucc() {
* @param boolean $rr
* @return number|\Yunpian\Sdk\Model\Result
*/
function code($code, $rr = false) {
function code($code = null, $rr = false) {
if (isset($code) || $rr) {
$this->code = $code;
return $this;
Expand All @@ -72,7 +72,7 @@ function code($code, $rr = false) {
* force to return $this
* @return string|\Yunpian\Sdk\Model\Result
*/
function msg($msg, $rr = false) {
function msg($msg = null, $rr = false) {
if (isset($msg) || $rr) {
$this->msg = $msg;
return $this;
Expand All @@ -87,7 +87,7 @@ function msg($msg, $rr = false) {
* force to return $this
* @return string|\Yunpian\Sdk\Model\Result
*/
function detail($detail, $rr = false) {
function detail($detail = null, $rr = false) {
if (isset($detail) || $rr) {
$this->detail = $detail;
return $this;
Expand All @@ -101,7 +101,7 @@ function detail($detail, $rr = false) {
* @param boolean $rr
* @return Exception|\Yunpian\Sdk\Model\Result
*/
function exception($e, $rr = false) {
function exception($e = null, $rr = false) {
if (isset($e) || $rr) {
$this->e = $e;
return $this;
Expand All @@ -115,7 +115,7 @@ function exception($e, $rr = false) {
* @param boolean $rr
* @return array|\Yunpian\Sdk\Model\Result
*/
function data($data, $rr = false) {
function data($data = null, $rr = false) {
if (isset($data) || $rr) {
$this->data = $data;
return $this;
Expand Down

0 comments on commit ca3a6e0

Please sign in to comment.