Treffynnon\Navigator\Coordinate::setParser PHP Method

setParser() public method

Set the parser that should be used to manage this coordinate
public setParser ( Treffynnon\Navigator\Coordinate\ParserInterface $parser )
$parser Treffynnon\Navigator\Coordinate\ParserInterface
    public function setParser(C\ParserInterface $parser)
    {
        $this->parser = $parser;
    }

Usage Example

Example #1
0
 /**
  * @dataProvider coordInvalidLongProvider
  * @expectedException Treffynnon\Navigator\Exception\InvalidCoordinateValueException
  */
 public function testInvalidSetLongCoordinate($coord)
 {
     $Coordinate = new N\Coordinate();
     // must set a parser and direction
     $Coordinate->setParser(new C\DecimalParser(N::LONG));
     $Coordinate->set($coord);
     $coord_out = (string) $Coordinate;
     $this->assertInternalType('string', $coord_out);
     $this->assertEquals($coord, $coord_out, '', 0.2);
 }
All Usage Examples Of Treffynnon\Navigator\Coordinate::setParser