PluginProbe
Auto Alt Text / trunk
Auto Alt Text vtrunk
3.0.3 2.8.2 1.3.1 1.3.2 2.0.0 2.1.0 2.1.1 2.2.0 2.3.0 2.3.1 2.3.2 2.3.3 2.3.4 2.4.0 2.4.1 2.4.2 2.5.0 2.5.1 2.5.2 2.5.3 2.6.0 2.6.1 2.7.0 2.8.0 2.8.1 All 28 releases
auto-alt-text / src / App / Services / AltTextGeneratorFactory.php

AltTextGeneratorFactory.php in Auto Alt Text trunk, at src/App/Services/AltTextGeneratorFactory.php

28 lines 924 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace AATXT\App\Services;
4
5 use AATXT\App\AltTextGeneratorInterface;
6 use AATXT\App\Domain\Exceptions\UnsupportedGeneratorException;
7
8 /**
9 * Factory interface for creating AltTextGenerator instances.
10 *
11 * This interface defines the contract for creating different types of
12 * alt text generators based on a configuration type.
13 *
14 * Following the Open/Closed Principle, new generator types can be added
15 * without modifying existing code, just by registering them in the factory.
16 */
17 interface AltTextGeneratorFactory
18 {
19 /**
20 * Create an alt text generator instance for the given type.
21 *
22 * @param string $type The generator type identifier (e.g., 'openai', 'anthropic', 'azure')
23 * @return AltTextGeneratorInterface The generator instance
24 * @throws UnsupportedGeneratorException If the type is not registered
25 */
26 public function create(string $type): AltTextGeneratorInterface;
27 }
28