Skip to content

Commit

Permalink
changeset::begin method takes optional parameter for requesting chang…
Browse files Browse the repository at this point in the history
…e to be reviewed after commit.
  • Loading branch information
kenguest committed May 13, 2020
1 parent 5e49942 commit 9957ab1
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions Services/OpenStreetMap/Changeset.php
Expand Up @@ -99,13 +99,14 @@ public function __construct(bool $atomic = true)
/**
* Begin changeset transaction.
*
* @param string $message The changeset log message.
* @param string $message The changeset log message.
* @param bool $reviewRequested Set if a review of the changes is required.
*
* @return void
* @throws Services_OpenStreetMap_RuntimeException If either user or
* password are not set.
*/
public function begin(string $message): void
public function begin(string $message, bool $reviewRequested = false): void
{
$response = null;
$code = null;
Expand All @@ -117,8 +118,11 @@ public function begin(string $message): void
'<osm version="0.6" generator="' . $userAgent . '">'
. "<changeset id='0' open='false'>"
. '<tag k="comment" v="' . $message . '"/>'
. '<tag k="created_by" v="' . $userAgent . '/0.1"/>'
. '</changeset></osm>';
. '<tag k="created_by" v="' . $userAgent . '/0.1"/>';
if ($reviewRequested) {
$doc .= '<tag k="review_requested" v="yes"/>';
}
$doc .= '</changeset></osm>';
$url = $config->getValue('server')
. 'api/'
. $config->getValue('api_version')
Expand Down

0 comments on commit 9957ab1

Please sign in to comment.