Merge pull request #53 from martinhipp/bugfix/tika-version-number-checking

Return version number as string instead of float
This commit is contained in:
Guy Marriott 2019-04-05 10:07:00 +13:00 committed by GitHub
commit c5cfe4ea1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -70,22 +70,22 @@ class TikaRestClient extends Client
/**
* Get version code
*
* @return float
* @return string
*/
public function getVersion()
{
/** @var Response $response */
$response = $this->get('version', $this->getGuzzleOptions());
$version = 0.0;
$version = 0;
// Parse output
if ($response->getStatusCode() == 200
&& preg_match('/Apache Tika (?<version>[\.\d]+)/', $response->getBody(), $matches)
) {
$version = (float)$matches['version'];
$version = $matches['version'];
}
return $version;
return (string) $version;
}
/**