Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
hasHooks example
protected
function
getHookedMethods
(
ReflectionClass
$class
)
{
return
array_filter
(
$class
->
getMethods
(
ReflectionMethod::IS_PUBLIC | ReflectionMethod::IS_PROTECTED
)
,
function
DReflectionMethod
$method
)
use
(
$class
)
{
return
!
$method
->
isConstructor
(
)
&& !
$method
->
isFinal
(
)
&& !
$method
->
isStatic
(
)
&& !
str_starts_with
(
$method
->
getName
(
)
, '__'
)
&&
$this
->hookManager->
hasHooks
(
$class
->
getName
(
)
,
$method
->
getName
(
)
)
;
}
)
;
}
/** * @return MethodGenerator */
protected
function
createMethodGenerator
(
ReflectionMethod
$method
)
{
$originalMethod
=
new
MethodReflection
(
$method
->
getDeclaringClass
(
)
->
getName
(
)
,