array_merge 대신 + 기호로 충분한 경우(dictionary) +로 변경함.
This commit is contained in:
+1
-3
@@ -1613,9 +1613,7 @@ function checkTurn() {
|
||||
$action = Json::decode($rawEvent['action']);
|
||||
$event = new Event\EventHandler($cond, $action);
|
||||
|
||||
$event->tryRunEvent(array_merge([
|
||||
'currentEventID'=>$eventID
|
||||
], $admin));
|
||||
$event->tryRunEvent(['currentEventID'=>$eventID] + $admin);
|
||||
}
|
||||
|
||||
// 분기계산. 장수들 턴보다 먼저 있다면 먼저처리
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ $defaultPost = [
|
||||
'neutralView' => false,
|
||||
'showMe' => true
|
||||
];
|
||||
$post = array_merge($defaultPost, WebUtil::parseJsonPost());
|
||||
$post = WebUtil::parseJsonPost() + $defaultPost;
|
||||
|
||||
if(!$session->isLoggedIn() || !$session->generalID){
|
||||
$post['neutralView'] = true;
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ namespace sammo;
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
|
||||
$v = new Validator(array_merge($_POST, $_GET));
|
||||
$v = new Validator($_GET + $_POST);
|
||||
$v
|
||||
->rule('required', [
|
||||
'name',
|
||||
|
||||
@@ -323,7 +323,7 @@ class CityConst{
|
||||
$queries = array_map(function(CityInitialDetail $city){
|
||||
$initValue = static::$buildInit[$city->level];
|
||||
$path = join('|', array_keys($city->path));
|
||||
return array_merge(static::$buildInitCommon, $initValue, [
|
||||
return [
|
||||
'city'=>$city->id,
|
||||
'name'=>$city->name,
|
||||
'level'=>$city->level,
|
||||
@@ -335,7 +335,7 @@ class CityConst{
|
||||
'def2'=>$city->defence,
|
||||
'wall2'=>$city->wall,
|
||||
'region'=>$city->region
|
||||
]);
|
||||
] + $initValue + static::$buildInitCommon;
|
||||
}, array_values(static::$constID));
|
||||
|
||||
DB::db()->insert('city', $queries);
|
||||
|
||||
@@ -70,12 +70,12 @@ foreach (AppConf::getList() as $setting) {
|
||||
];
|
||||
}
|
||||
|
||||
$state = array_merge($state, [
|
||||
$state += [
|
||||
'name' => $serverDir,
|
||||
'korName' => $serverKorName,
|
||||
'color' => $serverColor,
|
||||
'isRoot' => $serverDir == $rootServer
|
||||
]);
|
||||
];
|
||||
$server[] = $state;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ if($session->userGrade < 6){
|
||||
]);
|
||||
}
|
||||
|
||||
$request = array_merge($_POST, $_GET);
|
||||
$request = $_GET + $_POST;
|
||||
|
||||
$tmpFile = 'd_log/arc.zip';
|
||||
|
||||
|
||||
@@ -64,11 +64,11 @@ class Session
|
||||
'reason'=>'로그인이 필요합니다.'
|
||||
];
|
||||
|
||||
if (is_array($result)) {
|
||||
$jsonResult = array_merge($jsonResult, $result);
|
||||
if (!is_array($result)) {
|
||||
Json::die($jsonResult);
|
||||
}
|
||||
|
||||
Json::die($jsonResult);
|
||||
Json::die($result + $jsonResult);
|
||||
}
|
||||
|
||||
public static function requireLogin($result = '..'): Session
|
||||
|
||||
Reference in New Issue
Block a user