j_set_general_command, j_set_nation_command 구현

This commit is contained in:
2018-11-25 20:35:29 +09:00
parent be0439f771
commit c8f72b5f14
5 changed files with 274 additions and 28 deletions
+21
View File
@@ -582,4 +582,25 @@ class Util extends \utilphp\util
$reflect = new ReflectionClass($object);
return $reflect->getShortName();
}
/**
* 배열의 원소에 대해서 테스트를 수행하고 모두 true인지 확인
*/
public static function testArrayValues(array $array, ?callable $callback):bool{
if($callback === null){
foreach($array as $value){
if(!$value){
return false;
}
}
return true;
}
foreach($array as $value){
if(!($callback)($value)){
return false;
}
}
return true;
}
};