Skip to content

Commit

Permalink
Merge pull request #109 from uploadcare/fix/deprecate-user-agent
Browse files Browse the repository at this point in the history
Deprecate `$api->getUserAgent()` method and update patch version
  • Loading branch information
bautrukevich committed May 14, 2018
2 parents 8a2ac00 + a1b75c7 commit 4885d94
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based now on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [2.2.1] - 2018-05-14
### Deprecated
- `$api->getUserAgent()` was deprecated and will be removed in next major version. Use `$api->getUserAgentHeader()` instead.

## [2.2.0] - 2018-05-14
### Added
- Allow user to specify User Agent
Expand Down
12 changes: 11 additions & 1 deletion src/Uploadcare/Api.php
Expand Up @@ -9,7 +9,7 @@ class Api
/**
* Uploadcare library version
*/
const UPLOADCARE_LIBRARY_VERSION = '2.2.0';
const UPLOADCARE_LIBRARY_VERSION = '2.2.1';

/**
* Uploadcare public key
Expand Down Expand Up @@ -854,6 +854,16 @@ private function __setRequestType($ch, $type = 'GET')
}
}

/**
* Returns full user agent string.
* @deprecated 2.2.1 Use getUserAgentHeader() instead.
* @return string
*/
public function getUserAgent() {
Helper::deprecate('2.0.0', '3.0.0', 'Use getUserAgentHeader() instead');
return $this->getUserAgentHeader();
}

/**
* Returns full user agent string.
*
Expand Down

0 comments on commit 4885d94

Please sign in to comment.