1 | <?php |
||
36 | class LatLongParser implements ValueParser { |
||
37 | |||
38 | /* public */ const TYPE_FLOAT = 'float'; |
||
39 | /* public */ const TYPE_DMS = 'dms'; |
||
40 | /* public */ const TYPE_DM = 'dm'; |
||
41 | /* public */ const TYPE_DD = 'dd'; |
||
42 | |||
43 | /** |
||
44 | * The symbols representing the different directions for usage in directional notation. |
||
45 | */ |
||
46 | /* public */ const OPT_NORTH_SYMBOL = 'north'; |
||
47 | /* public */ const OPT_EAST_SYMBOL = 'east'; |
||
48 | /* public */ const OPT_SOUTH_SYMBOL = 'south'; |
||
49 | /* public */ const OPT_WEST_SYMBOL = 'west'; |
||
50 | |||
51 | /** |
||
52 | * The symbols representing degrees, minutes and seconds. |
||
53 | */ |
||
54 | /* public */ const OPT_DEGREE_SYMBOL = 'degree'; |
||
55 | /* public */ const OPT_MINUTE_SYMBOL = 'minute'; |
||
56 | /* public */ const OPT_SECOND_SYMBOL = 'second'; |
||
57 | |||
58 | /** |
||
59 | * The symbol to use as separator between latitude and longitude. |
||
60 | */ |
||
61 | /* public */ const OPT_SEPARATOR_SYMBOL = 'separator'; |
||
62 | |||
63 | /** |
||
64 | * @var ParserOptions |
||
65 | */ |
||
66 | private $options; |
||
67 | |||
68 | 50 | public function __construct( ParserOptions $options = null ) { |
|
72 | |||
73 | /** |
||
74 | * @see ValueParser::parse |
||
75 | * |
||
76 | * @param string $value |
||
77 | * |
||
78 | * @throws ParseException |
||
79 | * @return LatLongValue |
||
80 | */ |
||
81 | 50 | public function parse( $value ) { |
|
92 | |||
93 | /** |
||
94 | * @return StringValueParser[] |
||
95 | */ |
||
96 | 50 | protected function getParsers() { |
|
106 | |||
107 | /** |
||
108 | * Convenience function for determining if something is a valid coordinate string. |
||
109 | * Analogous to creating an instance of the parser, parsing the string and checking isValid on the result. |
||
110 | * |
||
111 | * @deprecated since 2.0, please instantiate and call isValid() instead |
||
112 | * |
||
113 | * @param string $string |
||
114 | * |
||
115 | * @return boolean |
||
116 | */ |
||
117 | public static function areCoordinates( $string ) { |
||
126 | |||
127 | } |
||
128 |