/** * Sets the scale control style. * * @param type $scaleControlStyle The scale control style. * * @throws \Ivory\GoogleMap\Exception\ControlException If the scale control style is not valid. */ public function setScaleControlStyle($scaleControlStyle) { if (!in_array($scaleControlStyle, ScaleControlStyle::getScaleControlStyles())) { throw ControlException::invalidScaleControlStyle(); } $this->scaleControlStyle = $scaleControlStyle; }
/** * Gets the "INVALID SCALE CONTROL STYLE" exception. * * @return \Ivory\GoogleMap\Exception\ControlException The "INVALID SCALE CONTROL STYLE" exception. */ public static function invalidScaleControlStyle() { return new static(sprintf('The scale control style of a scale control can only be : %s.', implode(', ', ScaleControlStyle::getScaleControlStyles()))); }
public function testScaleControlStyles() { $expected = array(ScaleControlStyle::DEFAULT_); $this->assertSame($expected, ScaleControlStyle::getScaleControlStyles()); }