From b2eefbe0427edc41719a3625919b721227d824e6 Mon Sep 17 00:00:00 2001 From: hedeqiang Date: Tue, 19 Nov 2019 09:01:36 +0000 Subject: [PATCH] Apply fixes from StyleCI --- src/IM.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/IM.php b/src/IM.php index bed59e0..7a9bd7b 100644 --- a/src/IM.php +++ b/src/IM.php @@ -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) @@ -122,6 +125,7 @@ protected function di($id = null) if ($id) { return $container->get($id); } + return $container; } }