added parent constructor
This commit is contained in:
		| @@ -16,13 +16,9 @@ abstract class BaseStructure { | ||||
| 	protected $maniaControl; | ||||
| 	private   $plainJson; | ||||
|  | ||||
| 	/** | ||||
| 	 * Sets ManiaControl | ||||
| 	 * | ||||
| 	 * @param \ManiaControl\ManiaControl $maniaControl | ||||
| 	 */ | ||||
| 	protected function setManiaControl(ManiaControl $maniaControl) { | ||||
| 	protected function __construct(ManiaControl $maniaControl, $data) { | ||||
| 		$this->maniaControl = $maniaControl; | ||||
| 		$this->setJson($data); | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| @@ -45,7 +41,7 @@ abstract class BaseStructure { | ||||
| 	 * Var_Dump the Structure | ||||
| 	 */ | ||||
| 	public function dump() { | ||||
| 		var_dump("Class Name including Namespace: " . get_class($this)); | ||||
| 		var_dump(json_decode(json_encode($this))); | ||||
| 		var_dump("Class Name including Namespace: " . get_class($this)); | ||||
| 	} | ||||
| } | ||||
| @@ -8,8 +8,8 @@ use ManiaControl\ManiaControl; | ||||
|  | ||||
| class StartServerStructure extends BaseStructure { | ||||
| 	public function __construct(ManiaControl $maniaControl, $data) { | ||||
| 		parent::setManiaControl($maniaControl); | ||||
| 		parent::setJson($data); | ||||
| 		parent::__construct($maniaControl, $data); | ||||
|  | ||||
|  | ||||
| 	} | ||||
| } | ||||
| @@ -15,8 +15,7 @@ use ManiaControl\ManiaControl; | ||||
|  */ | ||||
| class DefaultEventStructure extends BaseStructure { | ||||
| 	public function __construct(ManiaControl $maniaControl, $data) { | ||||
| 		parent::setManiaControl($maniaControl); | ||||
| 		parent::setJson($data); | ||||
| 		parent::__construct($maniaControl, $data); | ||||
|  | ||||
| 	} | ||||
| } | ||||
| @@ -15,8 +15,7 @@ use ManiaControl\ManiaControl; | ||||
|  */ | ||||
| class DefaultEventStructure extends BaseStructure { | ||||
| 	public function __construct(ManiaControl $maniaControl, $data) { | ||||
| 		parent::setManiaControl($maniaControl); | ||||
| 		parent::setJson($data); | ||||
| 		parent::__construct($maniaControl, $data); | ||||
|  | ||||
| 	} | ||||
| } | ||||
| @@ -25,11 +25,12 @@ class CallbacksListStructure extends BaseStructure { | ||||
| 	 * @param array        $data | ||||
| 	 */ | ||||
| 	public function __construct(ManiaControl $maniaControl, $data) { | ||||
| 		parent::setManiaControl($maniaControl); | ||||
| 		parent::setJson($data); | ||||
| 		parent::__construct($maniaControl, $data); | ||||
|  | ||||
| 		$this->responseId = $this->getJson()->responseid; | ||||
| 		$this->callbacks  = $this->getJson()->callbacks; | ||||
|  | ||||
| 		$this->dump(); | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
|   | ||||
		Reference in New Issue
	
	Block a user