Bitbucket API version float vs string

Issue #57 resolved
Stephan Vock created an issue

Discovered an issue with the Client::setApiVersion method. According to the docs the method expects a float (e.g. 2.0) but currently only passing a string (e.g. 2.0) seems to work. Also the library code + tests use the string value.

Was asked to create an issue for this in: https://bitbucket.org/gentlero/bitbucket-api/pull-requests/36/fix-phpdoc-in-clientinterface/diff#comment-33129126

Test script to reproduce the issue.

<?php

require_once __DIR__ . '/vendor/autoload.php';

$client = new \Bitbucket\API\Api();
$client->getClient()->setApiVersion(2.0);
echo $client->getClient()->getApiBaseUrl();

For current HEAD this throws InvalidArgumentException: Unsupported API version 2. For latest release 0.8.2 this outputs https://api.bitbucket.org/2

Note in both cases the missing .0 after the 2.

Happy to help in any way I can. Just let me know how you would like to see this solved.

Comments (2)

  1. Log in to comment