You are a developer and looking for Shopware projects?
Apply Now!
getLocaleFromFileName example
private
function
hydrateFiles
(
array
$files
)
: SnippetFileCollection
{
$snippetFileCollection
=
new
SnippetFileCollection
(
)
;
foreach
(
$files
as
$filePath
)
{
$fileName
=
basename
(
$filePath
)
;
$snippetFileCollection
->
add
(
new
GenericSnippetFile
(
$fileName
,
$filePath
,
$this
->
getLocaleFromFileName
(
$fileName
)
,
'Shopware',
false,
''
)
)
;
}
return
$snippetFileCollection
;
}
private
function
getLocaleFromFileName
(
string
$fileName
)
: string
{