added parent constructor

This commit is contained in:
kremsy 2017-03-23 21:01:44 +01:00
parent d2d6209880
commit 4b974e66c2
5 changed files with 10 additions and 15 deletions

View File

@ -16,13 +16,9 @@ abstract class BaseStructure {
protected $maniaControl; protected $maniaControl;
private $plainJson; private $plainJson;
/** protected function __construct(ManiaControl $maniaControl, $data) {
* Sets ManiaControl
*
* @param \ManiaControl\ManiaControl $maniaControl
*/
protected function setManiaControl(ManiaControl $maniaControl) {
$this->maniaControl = $maniaControl; $this->maniaControl = $maniaControl;
$this->setJson($data);
} }
/** /**
@ -45,7 +41,7 @@ abstract class BaseStructure {
* Var_Dump the Structure * Var_Dump the Structure
*/ */
public function dump() { public function dump() {
var_dump("Class Name including Namespace: " . get_class($this));
var_dump(json_decode(json_encode($this))); var_dump(json_decode(json_encode($this)));
var_dump("Class Name including Namespace: " . get_class($this));
} }
} }

View File

@ -8,8 +8,8 @@ use ManiaControl\ManiaControl;
class StartServerStructure extends BaseStructure { class StartServerStructure extends BaseStructure {
public function __construct(ManiaControl $maniaControl, $data) { public function __construct(ManiaControl $maniaControl, $data) {
parent::setManiaControl($maniaControl); parent::__construct($maniaControl, $data);
parent::setJson($data);
} }
} }

View File

@ -15,8 +15,7 @@ use ManiaControl\ManiaControl;
*/ */
class DefaultEventStructure extends BaseStructure { class DefaultEventStructure extends BaseStructure {
public function __construct(ManiaControl $maniaControl, $data) { public function __construct(ManiaControl $maniaControl, $data) {
parent::setManiaControl($maniaControl); parent::__construct($maniaControl, $data);
parent::setJson($data);
} }
} }

View File

@ -15,8 +15,7 @@ use ManiaControl\ManiaControl;
*/ */
class DefaultEventStructure extends BaseStructure { class DefaultEventStructure extends BaseStructure {
public function __construct(ManiaControl $maniaControl, $data) { public function __construct(ManiaControl $maniaControl, $data) {
parent::setManiaControl($maniaControl); parent::__construct($maniaControl, $data);
parent::setJson($data);
} }
} }

View File

@ -25,11 +25,12 @@ class CallbacksListStructure extends BaseStructure {
* @param array $data * @param array $data
*/ */
public function __construct(ManiaControl $maniaControl, $data) { public function __construct(ManiaControl $maniaControl, $data) {
parent::setManiaControl($maniaControl); parent::__construct($maniaControl, $data);
parent::setJson($data);
$this->responseId = $this->getJson()->responseid; $this->responseId = $this->getJson()->responseid;
$this->callbacks = $this->getJson()->callbacks; $this->callbacks = $this->getJson()->callbacks;
$this->dump();
} }
/** /**