Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
ClosureValue example
public
function
getTriggers
(
)
: int
{
return
Parser::TRIGGER_SUCCESS;
}
public
function
parse
(
&
$var
, Value &
$o
, int
$trigger
)
: void
{
if
(
!
$var
instanceof Closure
)
{
return
;
}
$object
=
new
ClosureValue
(
)
;
$object
->
transplant
(
$o
)
;
$o
=
$object
;
$object
->
removeRepresentation
(
'properties'
)
;
$closure
=
new
ReflectionFunction
(
$var
)
;
$o
->filename =
$closure
->
getFileName
(
)
;
$o
->startline =
$closure
->
getStartLine
(
)
;
foreach
(
$closure
->
getParameters
(
)
as
$param
)
{
$o
->parameters
[
]
=
new
ParameterValue
(
$param
)
;
}