diff --git a/src/GiteaData.php b/src/GiteaData.php index ace985b..7c402b1 100644 --- a/src/GiteaData.php +++ b/src/GiteaData.php @@ -4,8 +4,10 @@ namespace JHodges\GiteaBot; class GiteaData{ protected $data=null; + protected $newData=null; public function __construct($data=null){ + $this->newData=new stdClass(); if(!$data){ $data=new stdClass(); } @@ -14,6 +16,7 @@ class GiteaData{ public function __set($k,$v){ $this->data->$k=$v; + $this->newData->$k=$v; } public function __get($k){ diff --git a/src/GiteaRepoData.php b/src/GiteaRepoData.php index 5e8bb2f..33deb63 100644 --- a/src/GiteaRepoData.php +++ b/src/GiteaRepoData.php @@ -15,7 +15,7 @@ class GiteaRepoData extends GiteaData{ } public function save(){ - return $this->repo->request($this->url,'PATCH',$this->data); + return $this->repo->request($this->url,'PATCH',$this->newData); } }