# auto-alt-text/2.7.0/src/App/Services/AltTextGeneratorFactory.php

Auto Alt Text, version 2.7.0. 28 lines.

- Page: https://pluginprobe.com/plugins/auto-alt-text/2.7.0/code/src/App/Services/AltTextGeneratorFactory.php
- Raw: https://pluginprobe.com/plugins/auto-alt-text/2.7.0/raw/src/App/Services/AltTextGeneratorFactory.php
- Modified: 2026-01-14T13:38:28+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/auto-alt-text/2.7.0/code/src/App/Services/AltTextGeneratorFactory.php#L10-L20`.

```php
<?php

namespace AATXT\App\Services;

use AATXT\App\AltTextGeneratorInterface;
use AATXT\App\Domain\Exceptions\UnsupportedGeneratorException;

/**
 * Factory interface for creating AltTextGenerator instances.
 *
 * This interface defines the contract for creating different types of
 * alt text generators based on a configuration type.
 *
 * Following the Open/Closed Principle, new generator types can be added
 * without modifying existing code, just by registering them in the factory.
 */
interface AltTextGeneratorFactory
{
    /**
     * Create an alt text generator instance for the given type.
     *
     * @param string $type The generator type identifier (e.g., 'openai', 'anthropic', 'azure')
     * @return AltTextGeneratorInterface The generator instance
     * @throws UnsupportedGeneratorException If the type is not registered
     */
    public function create(string $type): AltTextGeneratorInterface;
}

```
