-
Notifications
You must be signed in to change notification settings - Fork 262
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed #180 - worklog visibility error.
- Loading branch information
KwangSeob Jeong
committed
Jul 28, 2018
1 parent
a34372a
commit 4a8cdc6
Showing
3 changed files
with
36 additions
and
44 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
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
namespace JiraRestApi\Issue; | ||
|
||
trait VisibilityTrait { | ||
|
||
/** | ||
* | ||
* @param Visibility $type | ||
* @param null $value | ||
* | ||
* @return $this | ||
*/ | ||
public function setVisibility($type, $value = null) | ||
{ | ||
if (is_null($this->visibility)) { | ||
$this->visibility = new Visibility(); | ||
} | ||
|
||
if (is_array($type)) { | ||
$this->visibility->setType($type['type']); | ||
$this->visibility->setValue($type['value']); | ||
} elseif ($type instanceof Visibility) { | ||
$this->visibility = $type; | ||
} else { | ||
$this->visibility->setType($type); | ||
$this->visibility->setValue($value); | ||
} | ||
|
||
return $this; | ||
} | ||
} |
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