namespace Shopware\Bundle\MailBundle\AutocompleteResolver;
class ForeachResolver extends AbstractResolver
{ private const FOREACH_REGEX = '/{foreach\s+\w+=[a-zA-Z0-9\$](.*)}/m';
private const ATTR_REGEX = '/(\s*(?<key>\w+)=(?<value>[a-zA-Z0-9\$]+)\s*)/';
public function completer(array
$context, string
$smartyCode): array
{ foreach ($this->
getMatches($smartyCode) as $match) { if (!
isset($match['from'
],
$match['item'
])) { continue;
} $value =
$this->
getValueFromPath($context,
$match['from'
]);
if ($value === null
) { continue;
} $count = \
count($value);