fixed number mismatch declerations
code cleanups
This commit is contained in:
		| @@ -4,7 +4,6 @@ namespace FML\Controls; | ||||
|  | ||||
| use FML\Script\Features\GraphCurve; | ||||
| use FML\Script\Features\GraphSettings; | ||||
| use FML\Script\Features\ScriptFeature; | ||||
|  | ||||
| /** | ||||
|  * Graph Control | ||||
| @@ -14,100 +13,92 @@ use FML\Script\Features\ScriptFeature; | ||||
|  * @copyright FancyManiaLinks Copyright © 2017 Steffen Schröder | ||||
|  * @license   http://www.gnu.org/licenses/ GNU General Public License, Version 3 | ||||
|  */ | ||||
| class Graph extends Control | ||||
| { | ||||
| class Graph extends Control { | ||||
|  | ||||
|     /** | ||||
|      * @var GraphSettings $graphSettings Graph settings | ||||
|      */ | ||||
|     protected $graphSettings = null; | ||||
| 	/** | ||||
| 	 * @var GraphSettings $graphSettings Graph settings | ||||
| 	 */ | ||||
| 	protected $graphSettings = null; | ||||
|  | ||||
|     /** | ||||
|      * @var GraphCurve[] $curves Curves | ||||
|      */ | ||||
|     protected $curves = array(); | ||||
| 	/** | ||||
| 	 * @var GraphCurve[] $curves Curves | ||||
| 	 */ | ||||
| 	protected $curves = array(); | ||||
|  | ||||
|     /** | ||||
|      * Get the graph settings | ||||
|      * | ||||
|      * @api | ||||
|      * @return GraphSettings | ||||
|      */ | ||||
|     public function getSettings() | ||||
|     { | ||||
|         if (!$this->graphSettings) { | ||||
|             $this->createSettings(); | ||||
|         } | ||||
|         return $this->graphSettings; | ||||
|     } | ||||
| 	/** | ||||
| 	 * Get the graph settings | ||||
| 	 * | ||||
| 	 * @api | ||||
| 	 * @return GraphSettings | ||||
| 	 */ | ||||
| 	public function getSettings() { | ||||
| 		if (!$this->graphSettings) { | ||||
| 			$this->createSettings(); | ||||
| 		} | ||||
| 		return $this->graphSettings; | ||||
| 	} | ||||
|  | ||||
|     /** | ||||
|      * Create new graph settings | ||||
|      * | ||||
|      * @return GraphSettings | ||||
|      */ | ||||
|     protected function createSettings() | ||||
|     { | ||||
|         $this->graphSettings = new GraphSettings($this); | ||||
|         $this->addScriptFeature($this->graphSettings); | ||||
|         return $this->graphSettings; | ||||
|     } | ||||
| 	/** | ||||
| 	 * Create new graph settings | ||||
| 	 * | ||||
| 	 * @return GraphSettings | ||||
| 	 */ | ||||
| 	protected function createSettings() { | ||||
| 		$this->graphSettings = new GraphSettings($this); | ||||
| 		$this->addScriptFeature($this->graphSettings); | ||||
| 		return $this->graphSettings; | ||||
| 	} | ||||
|  | ||||
|     /** | ||||
|      * Get curves | ||||
|      * | ||||
|      * @api | ||||
|      * @return GraphCurve[] | ||||
|      */ | ||||
|     public function getCurves() | ||||
|     { | ||||
|         return $this->curves; | ||||
|     } | ||||
| 	/** | ||||
| 	 * Get curves | ||||
| 	 * | ||||
| 	 * @api | ||||
| 	 * @return GraphCurve[] | ||||
| 	 */ | ||||
| 	public function getCurves() { | ||||
| 		return $this->curves; | ||||
| 	} | ||||
|  | ||||
|     /** | ||||
|      * Add curve | ||||
|      * | ||||
|      * @api | ||||
|      * @param GraphCurve $curve Curve | ||||
|      * @return static | ||||
|      */ | ||||
|     public function addCurve(GraphCurve $curve) | ||||
|     { | ||||
|         $curve->setGraph($this); | ||||
|         $this->addScriptFeature($curve); | ||||
|         array_push($this->curves, $curve); | ||||
|         return $this; | ||||
|     } | ||||
| 	/** | ||||
| 	 * Add curve | ||||
| 	 * | ||||
| 	 * @api | ||||
| 	 * @param GraphCurve $curve Curve | ||||
| 	 * @return static | ||||
| 	 */ | ||||
| 	public function addCurve(GraphCurve $curve) { | ||||
| 		$curve->setGraph($this); | ||||
| 		$this->addScriptFeature($curve); | ||||
| 		array_push($this->curves, $curve); | ||||
| 		return $this; | ||||
| 	} | ||||
|  | ||||
|     /** | ||||
|      * Add curves | ||||
|      * | ||||
|      * @api | ||||
|      * @param GraphCurve[] $curves Curves | ||||
|      * @return static | ||||
|      */ | ||||
|     public function addCurves(array $curves) | ||||
|     { | ||||
|         foreach ($curves as $curve) { | ||||
|             $this->addCurve($curve); | ||||
|         } | ||||
|         return $this; | ||||
|     } | ||||
| 	/** | ||||
| 	 * Add curves | ||||
| 	 * | ||||
| 	 * @api | ||||
| 	 * @param GraphCurve[] $curves Curves | ||||
| 	 * @return static | ||||
| 	 */ | ||||
| 	public function addCurves(array $curves) { | ||||
| 		foreach ($curves as $curve) { | ||||
| 			$this->addCurve($curve); | ||||
| 		} | ||||
| 		return $this; | ||||
| 	} | ||||
|  | ||||
|     /** | ||||
|      * @see Control::getTagName() | ||||
|      */ | ||||
|     public function getTagName() | ||||
|     { | ||||
|         return "graph"; | ||||
|     } | ||||
| 	/** | ||||
| 	 * @see Control::getTagName() | ||||
| 	 */ | ||||
| 	public function getTagName() { | ||||
| 		return "graph"; | ||||
| 	} | ||||
|  | ||||
|     /** | ||||
|      * @see Control::getManiaScriptClass() | ||||
|      */ | ||||
|     public function getManiaScriptClass() | ||||
|     { | ||||
|         return "CMlGraph"; | ||||
|     } | ||||
| 	/** | ||||
| 	 * @see Control::getManiaScriptClass() | ||||
| 	 */ | ||||
| 	public function getManiaScriptClass() { | ||||
| 		return "CMlGraph"; | ||||
| 	} | ||||
|  | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user