Skip to content

Commit

Permalink
Merge pull request #2 from hedeqiang/analysis-Xl6OxV
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
hedeqiang authored Nov 19, 2019
2 parents 38c4134 + b2eefbe commit 4f2a642
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/IM.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,19 +101,22 @@ protected function generateSign(string $identifier, int $expires = 15552000): st
{
$cache = $this->di()->get(CacheInterface::class);

if (!$cache->has($identifier.'_cache'))
{
if (!$cache->has($identifier.'_cache')) {
$api = new TLSSigAPIv2($this->config->get('sdk_app_id'), $this->config->get('secret_key'));
$sign = $api->genSig($identifier, $expires);
$cache->set($identifier.'_cache', $sign, $expires);

return $sign;
}

return $cache->get($identifier.'_cache');
}

/**
/**
* Finds an entry of the container by its identifier and returns it.
*
* @param null|mixed $id
*
* @return mixed|\Psr\Container\ContainerInterface
*/
protected function di($id = null)
Expand All @@ -122,6 +125,7 @@ protected function di($id = null)
if ($id) {
return $container->get($id);
}

return $container;
}
}

0 comments on commit 4f2a642

Please sign in to comment.