정적 분석기 결과 반영. 주로 배열 초기화. 변수 이름 실수 수정.

This commit is contained in:
2018-04-06 20:06:28 +09:00
parent 2bce82c73e
commit ffc0fc0c6f
20 changed files with 109 additions and 94 deletions
+4 -3
View File
@@ -2,6 +2,7 @@
namespace kakao;
if (class_exists('\\kakao\\KakaoKey') === false) {
/** @suppress PhanRedefineClass */
class KakaoKey
{
const REST_KEY = '';
@@ -106,12 +107,12 @@ class Kakao_REST_API_Helper
if ($api_path != '/oauth/token') {
if (in_array($api_path, self::$admin_apis)) {
if (!$this->admin_key) {
throw new Exception('admin key should not be null or empty.');
throw new \Exception('admin key should not be null or empty.');
}
$headers = array('Authorization: KakaoAK ' . $this->admin_key);
} else {
if (!$this->access_token) {
throw new Exception('access token should not be null or empty.');
throw new \Exception('access token should not be null or empty.');
}
$headers = array('Authorization: Bearer ' . $this->access_token);
}
@@ -134,7 +135,7 @@ class Kakao_REST_API_Helper
$return_data = curl_exec($curl_session);
if (curl_errno($curl_session)) {
throw new Exception(curl_error($curl_session));
throw new \Exception(curl_error($curl_session));
} else {
// 디버깅 시에 주석을 풀고 응답 내용 확인할 때
//print_r(curl_getinfo($curl_session));