val = (self::isStopType($val)) ? $val : 'clear'; // Default to 0 if the position is non-numeric $this->position = (is_numeric($position)) ? intval($position) : 0; // Default to null if no tab leader $this->leader = (self::isLeaderType($leader)) ? $leader : null; } /** * Get stop type * * @return string */ public function getStopType() { return $this->val; } /** * Get leader * * @return string */ public function getLeader() { return $this->leader; } /** * Get position * * @return integer */ public function getPosition() { return $this->position; } /** * Test if attribute is a valid stop type. * * @param string $attribute * @return bool True if it is; false otherwise. */ private static function isStopType($attribute) { return in_array($attribute, self::$possibleStopTypes); } /** * Test if attribute is a valid leader type. * * @param string $attribute * @return bool True if it is; false otherwise. */ private static function isLeaderType($attribute) { return in_array($attribute, self::$possibleLeaders); } }