Skip to content
This repository has been archived by the owner on Dec 14, 2018. It is now read-only.

Commit

Permalink
add constraint for php version and trigger error E_USER_DEPRECATED wh…
Browse files Browse the repository at this point in the history
…en local version of php does not meet or exceed
  • Loading branch information
Brian Retterer committed Jan 3, 2017
1 parent 1b3dde2 commit ec9dc75
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,12 @@ class Client extends Magic
public function __construct(ApiKey $apiKey, $cacheManager, $cacheManagerOptions, $baseUrl = null, RequestSigner $requestSigner = null, $authenticationScheme = Stormpath::SAUTHC1_AUTHENTICATION_SCHEME, HttpClient $httpClient = null, MessageFactory $messageFactory = null, UriFactory $uriFactory = null)
{
parent::__construct();
self::$cacheManager = $cacheManager;

if(version_compare(PHP_VERSION, \Stormpath\Util\Version::PHP_VERSION_MIN, '<')) {
@trigger_error('The Stormpath PHP SDK has deprecated your version of PHP `'.PHP_VERSION.'`. Please update to at PHP Version ' . \Stormpath\Util\Version::PHP_VERSION_MIN, E_USER_DEPRECATED);
}

self::$cacheManager = $cacheManager;
self::$cacheManagerOptions = $cacheManagerOptions;

if (is_string($cacheManager)) { // Legacy cache manager
Expand Down
2 changes: 1 addition & 1 deletion src/Util/Version.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@
class Version
{
const SDK_VERSION = '1.18.0';

const PHP_VERSION_MIN = '5.6.0';
}

0 comments on commit ec9dc75

Please sign in to comment.