| @@ 57-67 (lines=11) @@ | ||
| 54 | * |
|
| 55 | * @return Details |
|
| 56 | */ |
|
| 57 | public function osmId(string $osmType, int $osmId): self |
|
| 58 | { |
|
| 59 | if (!\in_array($osmType, Consts\OsmTypes::all(), true)) { |
|
| 60 | throw new InvalidParameterException('Osm type is invalid'); |
|
| 61 | } |
|
| 62 | ||
| 63 | $this->query['osmtype'] = $osmType; |
|
| 64 | $this->query['osmid'] = $osmId; |
|
| 65 | ||
| 66 | return $this; |
|
| 67 | } |
|
| 68 | } |
|
| 69 | ||
| @@ 51-60 (lines=10) @@ | ||
| 48 | * |
|
| 49 | * @return \maxh\Nominatim\Reverse |
|
| 50 | */ |
|
| 51 | public function osmType(string $type): self |
|
| 52 | { |
|
| 53 | if (\in_array($type, $this->osmType, true)) { |
|
| 54 | $this->query['osm_type'] = $type; |
|
| 55 | ||
| 56 | return $this; |
|
| 57 | } |
|
| 58 | ||
| 59 | throw new InvalidParameterException('OSM Type is not supported'); |
|
| 60 | } |
|
| 61 | ||
| 62 | /** |
|
| 63 | * A specific osm node / way / relation to return an address for. |
|