Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
findRouteNameContaining example
$io
=
new
SymfonyStyle
(
$input
,
$output
)
;
$name
=
$input
->
getArgument
(
'name'
)
;
$helper
=
new
DescriptorHelper
(
$this
->fileLinkFormatter
)
;
$routes
=
$this
->router->
getRouteCollection
(
)
;
$container
= null;
if
(
$this
->fileLinkFormatter
)
{
$container
=
fn
(
)
=>
$this
->
getContainerBuilder
(
$this
->
getApplication
(
)
->
getKernel
(
)
)
;
}
if
(
$name
)
{
$route
=
$routes
->
get
(
$name
)
;
$matchingRoutes
=
$this
->
findRouteNameContaining
(
$name
,
$routes
)
;
if
(
!
$input
->
isInteractive
(
)
&& !
$route
&& \
count
(
$matchingRoutes
)
> 1
)
{
$helper
->
describe
(
$io
,
$this
->
findRouteContaining
(
$name
,
$routes
)
,
[
'format' =>
$input
->
getOption
(
'format'
)
,
'raw_text' =>
$input
->
getOption
(
'raw'
)
,
'show_controllers' =>
$input
->
getOption
(
'show-controllers'
)
,
'output' =>
$io
,
]
)
;
return
0;
}