Location\Formatter\Coordinate\DecimalMinutes::setUnits PHP Method

setUnits() public method

public setUnits ( string $type )
$type string
    public function setUnits($type)
    {
        if (!array_key_exists($type, $this->units)) {
            throw new \InvalidArgumentException("Invalid unit type");
        }
        $this->unitType = $type;
    }

Usage Example

Beispiel #1
0
 /**
  * @covers Location\Formatter\Coordinate\DMS::setUnits
  * @expectedException \InvalidArgumentException
  * @expectedExceptionMessage Invalid unit type
  */
 public function testSetUnitsInvalidType()
 {
     $this->formatter->setUnits('invalid');
 }