-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement more options for the branch() method
- Loading branch information
1 parent
617bad4
commit 2409466
Showing
2 changed files
with
54 additions
and
12 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 Platformsh\Client\Model\Environment; | ||
|
||
final class BranchOptions { | ||
/** @var string */ | ||
private $id; | ||
/** @var string|null */ | ||
private $title; | ||
/** @var bool|null */ | ||
private $clone_parent; | ||
/** @var string|null */ | ||
private $type; | ||
|
||
public function __construct($id, $title = null, $cloneParent = null, $type = null) | ||
{ | ||
$this->id = $id; | ||
$this->title = $title; | ||
$this->clone_parent = $cloneParent; | ||
$this->type = $type; | ||
} | ||
|
||
public function toArray() { | ||
$arr = []; | ||
foreach ($this as $key => $value) { | ||
if ($value !== null) { | ||
$arr[$key] = $value; | ||
} | ||
} | ||
return $arr; | ||
} | ||
} |