reformat curry() to make my editor happy
This commit is contained in:
parent
70fc32c5b9
commit
0056b635c6
23
lib/util.php
23
lib/util.php
@ -457,7 +457,7 @@ function callback_helper($matches, $callback, $notice_id) {
|
|||||||
$url=$matches[1];
|
$url=$matches[1];
|
||||||
$left = strpos($matches[0],$url);
|
$left = strpos($matches[0],$url);
|
||||||
$right = $left+strlen($url);
|
$right = $left+strlen($url);
|
||||||
|
|
||||||
$groupSymbolSets=array(
|
$groupSymbolSets=array(
|
||||||
array(
|
array(
|
||||||
'left'=>'(',
|
'left'=>'(',
|
||||||
@ -491,9 +491,7 @@ function callback_helper($matches, $callback, $notice_id) {
|
|||||||
$url=substr($url,0,-1);
|
$url=substr($url,0,-1);
|
||||||
}
|
}
|
||||||
}while($original_url!=$url);
|
}while($original_url!=$url);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(empty($notice_id)){
|
if(empty($notice_id)){
|
||||||
$result = call_user_func_array($callback,$url);
|
$result = call_user_func_array($callback,$url);
|
||||||
}else{
|
}else{
|
||||||
@ -508,16 +506,13 @@ function curry($fn) {
|
|||||||
array_shift($args);
|
array_shift($args);
|
||||||
$id = uniqid('_partial');
|
$id = uniqid('_partial');
|
||||||
$GLOBALS[$id] = array($fn, $args);
|
$GLOBALS[$id] = array($fn, $args);
|
||||||
return create_function(
|
return create_function('',
|
||||||
'',
|
'$args = func_get_args(); '.
|
||||||
'
|
'return call_user_func_array('.
|
||||||
$args = func_get_args();
|
'$GLOBALS["'.$id.'"][0],'.
|
||||||
return call_user_func_array(
|
'array_merge('.
|
||||||
$GLOBALS["'.$id.'"][0],
|
'$args,'.
|
||||||
array_merge(
|
'$GLOBALS["'.$id.'"][1]));');
|
||||||
$args,
|
|
||||||
$GLOBALS["'.$id.'"][1]));
|
|
||||||
');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function common_linkify($url) {
|
function common_linkify($url) {
|
||||||
|
Loading…
Reference in New Issue
Block a user