Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getAvailableBundles example
$configs
=
$container
->
getExtensionConfig
(
$extensionAlias
)
;
$configuration
=
$extension
instanceof ConfigurationInterface ?
$extension
:
$extension
->
getConfiguration
(
$configs
,
$container
)
;
$this
->
validateConfiguration
(
$extension
,
$configuration
)
;
return
(
new
Processor
(
)
)
->
processConfiguration
(
$configuration
,
$configs
)
;
}
public
function
complete
(
CompletionInput
$input
, CompletionSuggestions
$suggestions
)
: void
{
if
(
$input
->
mustSuggestArgumentValuesFor
(
'name'
)
)
{
$suggestions
->
suggestValues
(
$this
->
getAvailableExtensions
(
)
)
;
$suggestions
->
suggestValues
(
$this
->
getAvailableBundles
(
)
)
;
return
;
}
if
(
$input
->
mustSuggestArgumentValuesFor
(
'path'
)
&& null !==
$name
=
$input
->
getArgument
(
'name'
)
)
{
try
{
$config
=
$this
->
getConfig
(
$this
->
findExtension
(
$name
)
,
$this
->
compileContainer
(
)
)
;
$paths
=
array_keys
(
self::
buildPathsCompletion
(
$config
)
)
;
$suggestions
->
suggestValues
(
$paths
)
;
}
catch
(
LogicException
)
{
}
}
$io
->
writeln
(
null ===
$path
?
$dumper
->
dump
(
$configuration
,
$extension
->
getNamespace
(
)
)
:
$dumper
->
dumpAtPath
(
$configuration
,
$path
)
)
;
return
0;
}
public
function
complete
(
CompletionInput
$input
, CompletionSuggestions
$suggestions
)
: void
{
if
(
$input
->
mustSuggestArgumentValuesFor
(
'name'
)
)
{
$suggestions
->
suggestValues
(
$this
->
getAvailableExtensions
(
)
)
;
$suggestions
->
suggestValues
(
$this
->
getAvailableBundles
(
)
)
;
}
if
(
$input
->
mustSuggestOptionValuesFor
(
'format'
)
)
{
$suggestions
->
suggestValues
(
$this
->
getAvailableFormatOptions
(
)
)
;
}
}
private
function
getAvailableExtensions
(
)
: array
{
$kernel
=
$this
->
getApplication
(
)
->
getKernel
(
)
;