* @copyright Since 2007 PrestaShop SA and Contributors * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) */ declare(strict_types=1); namespace PrestaShop\Module\PsxDesign\Factory\ThemeConfiguration; if (!defined('_PS_VERSION_')) { exit; } use PrestaShop\Module\PsxDesign\DTO\ThemeConfiguration\Font\PsxDesignFontCategoryConfiguration; use PrestaShop\Module\PsxDesign\DTO\ThemeConfiguration\Font\PsxDesignFontConfiguration; class FontsConfigurationFactory extends AbstractThemeConfigurationFactory { public function __construct(string $themeName) { parent::__construct($themeName); } /** * @return PsxDesignFontConfiguration[]|null */ public function getFonts(): ?array { return $this->configurations ? $this->configurations->getFonts() : null; } /** * @return PsxDesignFontCategoryConfiguration[] */ public function getFontCategories(): array { if (!($this->configurations && $this->configurations->getFontsCategories())) { return []; } return $this->configurations->getFontsCategories(); } /** * @return bool */ public function provideFontFeatureAvailability(): bool { return $this->configurations && $this->configurations->getFonts(); } }