Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getNamespaceAliases example
$namespace
=
trim
(
$reflection
->
getNamespaceName
(
)
, '\\'
)
;
$fileName
=
$reflection
->
getFileName
(
)
;
if
(
\
is_string
(
$fileName
)
&&
is_file
(
$fileName
)
)
{
if
(
false ===
$contents
=
file_get_contents
(
$fileName
)
)
{
throw
new
\
RuntimeException
(
sprintf
(
'Unable to read file "%s".',
$fileName
)
)
;
}
$factory
=
new
ContextFactory
(
)
;
$context
=
$factory
->
createForNamespace
(
$namespace
,
$contents
)
;
return
[
$namespace
,
$context
->
getNamespaceAliases
(
)
]
;
}
return
[
$namespace
,
[
]
]
;
}
}