25 lines
569 B
PHP
25 lines
569 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
namespace Esun\FileManager\Model\Source;
|
|
|
|
use Esun\FileManager\Model\Config;
|
|
use Magento\Framework\Data\OptionSourceInterface;
|
|
|
|
class ExtensionOptions implements OptionSourceInterface
|
|
{
|
|
public function __construct(private readonly Config $config)
|
|
{
|
|
}
|
|
|
|
public function toOptionArray(): array
|
|
{
|
|
$options = [];
|
|
foreach ($this->config->getAllowedExtensions() as $extension) {
|
|
$options[] = ['value' => $extension, 'label' => strtoupper($extension)];
|
|
}
|
|
|
|
return $options;
|
|
}
|
|
}
|