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

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));
+8 -4
View File
@@ -32,8 +32,10 @@ class AppConf
public static function requireRootDB()
{
if (!class_exists('\\sammo\\RootDB')) {
trigger_error('RootDB.php가 설정되지 않았습니다.', E_USER_ERROR);
die();
if(!trigger_error('RootDB.php가 설정되지 않았습니다.', E_USER_ERROR)){
die();
}
}
return RootDB::db();
}
@@ -46,8 +48,10 @@ class AppConf
public static function requireDB()
{
if (!class_exists('\\sammo\\DB')) {
trigger_error('DB.php가 설정되지 않았습니다.', E_USER_ERROR);
die();
if(!trigger_error('DB.php가 설정되지 않았습니다.', E_USER_ERROR)){
die();
}
}
return DB::db();
}
+2 -3
View File
@@ -40,7 +40,7 @@ class FileUtil
$filepath = sprintf('%s/%s', $dir, $FolderOrFile);
if (is_dir($filepath)) {
delExpiredInDir($filepath, $t);
static::delExpiredInDir($filepath, $t);
} // recursive
else {
$mt = filemtime($filepath);
@@ -51,7 +51,6 @@ class FileUtil
}
closedir($handle);
}
return $success;
}
}