Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F568379
PhabricatorSumChartFunction.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
791 B
Referenced Files
None
Subscribers
None
PhabricatorSumChartFunction.php
View Options
<?php
final
class
PhabricatorSumChartFunction
extends
PhabricatorHigherOrderChartFunction
{
const
FUNCTIONKEY
=
'sum'
;
protected
function
newArguments
()
{
return
array
(
$this
->
newArgument
()
->
setName
(
'f'
)
->
setType
(
'function'
)
->
setRepeatable
(
true
),
);
}
public
function
evaluateFunction
(
array
$xv
)
{
$fv
=
array
();
foreach
(
$this
->
getFunctionArguments
()
as
$function
)
{
$fv
[]
=
$function
->
evaluateFunction
(
$xv
);
}
$n
=
count
(
$xv
);
$yv
=
array_fill
(
0
,
$n
,
null
);
foreach
(
$fv
as
$f
)
{
for
(
$ii
=
0
;
$ii
<
$n
;
$ii
++)
{
if
(
$f
[
$ii
]
!==
null
)
{
if
(!
isset
(
$yv
[
$ii
]))
{
$yv
[
$ii
]
=
0
;
}
$yv
[
$ii
]
+=
$f
[
$ii
];
}
}
}
return
$yv
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, May 13, 1:24 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
124490
Default Alt Text
PhabricatorSumChartFunction.php (791 B)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment